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

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Swkweb\ProductSet;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. class SwkwebProductSet 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 */
  18.         $connection $this->container->get(Connection::class);
  19.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_slot_assignment;');
  20.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_option_translation;');
  21.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_option;');
  22.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_slot_translation;');
  23.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_slot;');
  24.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_price_calculation;');
  25.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_product;');
  26.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_translation;');
  27.         $connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set;');
  28.     }
  29. }