custom/plugins/PixelLexikonSW6/src/PixelLexikonSW6.php line 14

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Pixel\LexikonSW6;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  6. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  7. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  8. use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
  9. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  10. class PixelLexikonSW6 extends Plugin
  11. {
  12.     public function install(InstallContext $context): void
  13.     {
  14.         parent::install($context);
  15.     }
  16.     public function update(UpdateContext $context): void
  17.     {
  18.     }
  19.     public function uninstall(UninstallContext $context): void
  20.     {
  21.         parent::uninstall($context);
  22.         if ($context->keepUserData()) {
  23.             return;
  24.         }
  25.         $connection $this->container->get(Connection::class);
  26.         $connection->executeStatement('SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;');
  27.         $connection->executeStatement('DROP TABLE IF EXISTS `pixel_lexikon_categories_translation`');
  28.         $connection->executeStatement('DROP TABLE IF EXISTS `pixel_lexikon_categories`');
  29.         $connection->executeStatement('DROP TABLE IF EXISTS `pixel_lexikon_translation`');
  30.         $connection->executeStatement('DROP TABLE IF EXISTS `pixel_lexikon_categories_ro`');
  31.         $connection->executeStatement('DROP TABLE IF EXISTS `pixel_lexikon_sales_channel`');
  32.         $connection->executeStatement('DROP TABLE IF EXISTS `pixel_lexikon`');
  33.         $connection->executeStatement('DROP TABLE IF EXISTS `pixel_lexikon_media`');
  34.         $connection->executeStatement('DROP TABLE IF EXISTS `pixel_lexcat_channels`');
  35.         $connection->executeStatement('DROP TABLE IF EXISTS pixel_lexikon_channels`');
  36.         $connection->executeStatement('DROP TABLE IF EXISTS pixel_lexikon_products`');
  37.         $connection->executeStatement('DELETE FROM `seo_url_template` WHERE  `route_name`="frontend.lexikon.listing";');
  38.         $connection->executeStatement('DELETE FROM `seo_url_template` WHERE  `route_name`="frontend.lexikon.detail";');
  39.         $connection->executeStatement('SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;');
  40.     }
  41.     public function activate(ActivateContext $context): void
  42.     {
  43.         parent::activate($context);
  44.     }
  45.     public function deactivate(DeactivateContext $context): void
  46.     {
  47.         parent::deactivate($context);
  48.     }
  49. }