custom/plugins/SwkwebBuyXPayY/src/SwkwebBuyXPayY.php line 9

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Swkweb\BuyXPayY;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. final class SwkwebBuyXPayY extends Plugin
  7. {
  8.     public function uninstall(UninstallContext $uninstallContext): void
  9.     {
  10.         if ($uninstallContext->keepUserData()) {
  11.             return;
  12.         }
  13.         $this->dropSchema();
  14.     }
  15.     private function dropSchema(): void
  16.     {
  17.         /** @var Connection $connection */
  18.         $connection $this->container->get(Connection::class);
  19.         $connection->executeUpdate('DROP TABLE IF EXISTS swkweb_buy_x_pay_y_promotion_translation');
  20.         $connection->executeUpdate('DROP TABLE IF EXISTS swkweb_buy_x_pay_y_promotion');
  21.     }
  22. }