custom/plugins/SwpPriceOnRequestSix/src/SwpPriceOnRequestSix.php line 26

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /**
  3.  * Shopware
  4.  * Copyright © 2020
  5.  *
  6.  * @category   Shopware
  7.  * @package    SwpPriceOnRequestSix
  8.  * @subpackage SwpPriceOnRequestSix.php
  9.  *
  10.  * @copyright  2020 Iguana-Labs GmbH
  11.  * @author     Module Factory <info at module-factory.com>
  12.  * @license    https://www.module-factory.com/eula
  13.  */
  14. namespace Swp\PriceOnRequestSix;
  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\UninstallContext;
  20. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  21. use Swp\PriceOnRequestSix\Utils\CustomFieldInstaller;
  22. use Swp\PriceOnRequestSix\Utils\InstallUninstall;
  23. class SwpPriceOnRequestSix extends Plugin
  24. {
  25.     public function install(InstallContext $installContext): void
  26.     {
  27.         parent::install($installContext);
  28.         (new InstallUninstall($this->container))->install($installContext->getContext());
  29.     }
  30.     public function uninstall(UninstallContext $uninstallContext): void
  31.     {
  32.         parent::uninstall($uninstallContext);
  33.         if ($uninstallContext->keepUserData()) {
  34.             return;
  35.         }
  36.         (new InstallUninstall($this->container))->uninstall($uninstallContext->getContext());
  37.         (new CustomFieldInstaller($this->container))->uninstall($uninstallContext);
  38.     }
  39.     public function activate(ActivateContext $activateContext): void
  40.     {
  41.         (new CustomFieldInstaller($this->container))->activate($activateContext);
  42.         parent::activate($activateContext);
  43.     }
  44.     public function deactivate(DeactivateContext $deactivateContext): void
  45.     {
  46.         (new CustomFieldInstaller($this->container))->deactivate($deactivateContext);
  47.         parent::deactivate($deactivateContext);
  48.     }
  49.     public function postUpdate(UpdateContext $updateContext): void
  50.     {
  51.         (new CustomFieldInstaller($this->container))->activate($updateContext);
  52.     }
  53. }