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

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace ShopWithMe\OGOship;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  7. use ShopWithMe\OGOship\Lifecycle\InstallerFactory;
  8. use ShopWithMe\OGOship\Service\InstallerInterface;
  9. class ShopWithMeOGOship 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.         // $connection = $this->container->get(Connection::class);
  34.         // $connection->executeStatement('DROP TABLE IF EXISTS `swm_reward_point`');
  35.         // $connection->executeStatement('DROP TABLE IF EXISTS `swm_reward_config`');
  36.     }
  37. }