custom/plugins/ShopWithMeOpenGraph/src/ShopWithMeOpenGraph.php line 12

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