custom/plugins/ShopWithMeUI/src/ShopWithMeUI.php line 13

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace ShopWithMe\UI;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Storefront\Framework\ThemeInterface;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  7. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  8. use ShopWithMe\UI\Lifecycle\InstallerFactory;
  9. use ShopWithMe\UI\Service\InstallerInterface;
  10. class ShopWithMeUI extends Plugin implements ThemeInterface
  11. {
  12.     public function install(InstallContext $installContext): void
  13.     {
  14.         $this->getInstaller()->install($installContext);
  15.     }
  16.     public function update(UpdateContext $updateContext): void
  17.     {
  18.         $this->getInstaller()->update($updateContext);
  19.     }
  20.     protected function getInstaller(): InstallerInterface
  21.     {
  22.         $factory = new InstallerFactory($this->container);
  23.         return $factory->create();
  24.     }
  25.     /**
  26.      * @param UninstallContext $context
  27.      */
  28.     public function uninstall(UninstallContext $context): void
  29.     {
  30.         parent::uninstall($context);
  31.         if ($context->keepUserData()) {
  32.             return;
  33.         }
  34.     }
  35. }