custom/static-plugins/UjyImport/src/UjyImport.php line 10

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Ujy\Import;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  6. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  7. class UjyImport extends Plugin
  8. {
  9.     public function activate(ActivateContext $activateContext): void
  10.     {
  11.     }
  12.     public function uninstall(UninstallContext $uninstallContext): void
  13.     {
  14.         parent::uninstall($uninstallContext);
  15.         if ($uninstallContext->keepUserData()) {
  16.             return;
  17.         }
  18.         $connection $this->container->get(Connection::class);
  19.         // Sangebot import
  20.         $connection->executeStatement('ALTER TABLE ujy_sangebot_to_category DROP index `unique.sangebot_id.name`');
  21.         $connection->executeStatement('ALTER TABLE ujy_sangebot_to_category DROP index `sangebot_id`');
  22.         $connection->executeStatement('DROP TABLE IF EXISTS `ujy_sangebot_to_category`');
  23.         // Remote product description
  24.         $connection->executeStatement('ALTER TABLE ujy_product_description DROP index `unique.vendor_code`');
  25.         $connection->executeStatement('DROP TABLE IF EXISTS `ujy_product_description`');
  26.     }
  27. }