custom/plugins/SwpCategoryAssignedProductsSix/src/SwpCategoryAssignedProductsSix.php line 25

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /**
  3.  * Shopware
  4.  * Copyright © 2022
  5.  *
  6.  * @category   Shopware
  7.  * @package    sw-6
  8.  * @subpackage SwpCategoryAssignedProductsSix.php
  9.  *
  10.  * @copyright  2022 Iguana-Labs GmbH
  11.  * @author     Module Factory <info at module-factory.com>
  12.  * @license    https://www.module-factory.com/eula
  13.  */
  14. namespace Swp\CategoryAssignedProductsSix;
  15. use Shopware\Core\Framework\Plugin;
  16. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  17. use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
  18. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  19. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  20. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  21. use Swp\CategoryAssignedProductsSix\Utils\InstallUninstall;
  22. class SwpCategoryAssignedProductsSix extends Plugin
  23. {
  24.     /**
  25.      *
  26.      * @param InstallContext $installContext
  27.      */
  28.     public function install(InstallContext $installContext): void
  29.     {
  30.         (new InstallUninstall($this->container))->install($installContext->getContext());
  31.         parent::install($installContext);
  32.     }
  33.     /**
  34.      *
  35.      * @param UpdateContext $updateContext
  36.      */
  37.     public function update(UpdateContext $updateContext): void
  38.     {
  39.         (new InstallUninstall($this->container))->update($updateContext->getContext());
  40.         parent::update($updateContext);
  41.     }
  42.     /**
  43.      *
  44.      * @param UninstallContext $uninstallContext
  45.      */
  46.     public function uninstall(UninstallContext $uninstallContext): void
  47.     {
  48.         parent::uninstall($uninstallContext);
  49.         if ($uninstallContext->keepUserData()) {
  50.             return;
  51.         }
  52.         (new InstallUninstall($this->container))->uninstall($uninstallContext->getContext());
  53.     }
  54.     /**
  55.      *
  56.      * @param ActivateContext $activateContext
  57.      */
  58.     public function activate(ActivateContext $activateContext): void
  59.     {
  60.         parent::activate($activateContext);
  61.     }
  62.     /**
  63.      *
  64.      * @param DeactivateContext $deactivateContext
  65.      */
  66.     public function deactivate(DeactivateContext $deactivateContext): void
  67.     {
  68.         parent::deactivate($deactivateContext);
  69.     }
  70. }