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

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace ShopWithMe\BankTransfer;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\Plugin;
  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\BankTransfer\Lifecycle\InstallerFactory;
  9. use ShopWithMe\BankTransfer\Service\InstallerInterface;
  10. class ShopWithMeBankTransfer extends Plugin
  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.     // $connection = $this->container->get(Connection::class);
  35.     // $connection->executeStatement('DROP TABLE IF EXISTS `swm_reward_point`');
  36.     // $connection->executeStatement('DROP TABLE IF EXISTS `swm_reward_config`');
  37.   }
  38. }