custom/plugins/NetiNextProductDetailCms/src/NetiNextProductDetailCms.php line 11

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace NetInventors\NetiNextProductDetailCms;
  3. use Doctrine\DBAL\Connection;
  4. use Doctrine\DBAL\Exception;
  5. use Shopware\Core\Framework\Plugin;
  6. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  7. use Symfony\Component\DependencyInjection\ContainerInterface;
  8. class NetiNextProductDetailCms extends Plugin
  9. {
  10.     /**
  11.      * @throws Exception
  12.      */
  13.     public function uninstall(UninstallContext $uninstallContext): void
  14.     {
  15.         parent::uninstall($uninstallContext);
  16.         if ($this->container instanceof ContainerInterface && false === $uninstallContext->keepUserData()) {
  17.             $connection $this->container->get(Connection::class);
  18.             if (!$connection instanceof Connection) {
  19.                 return;
  20.             }
  21.             $connection->executeStatement(
  22.                 'DROP TABLE IF EXISTS `neti_product_cms_sales_channel`, `neti_product_cms`, `neti_pdc_template_marker`'
  23.             );
  24.         }
  25.     }
  26. }