vendor/store.shopware.com/netinextmodal/src/NetiNextModal.php line 20

Open in your IDE?
  1. <?php
  2. /**
  3.  * @category NetiNextModal
  4.  * @author   bmueller
  5.  */
  6. namespace NetInventors\NetiNextModal;
  7. use Doctrine\DBAL\Connection;
  8. use Doctrine\DBAL\DBALException;
  9. use Shopware\Core\Framework\Plugin;
  10. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  11. use Symfony\Component\DependencyInjection\ContainerInterface;
  12. /**
  13.  * Class NetiNextModal
  14.  *
  15.  * @package NetInventors\NetiNextModal
  16.  */
  17. class NetiNextModal extends Plugin
  18. {
  19.     /**
  20.      * @param UninstallContext $uninstallContext
  21.      *
  22.      * @throws DBALException
  23.      */
  24.     public function uninstall(UninstallContext $uninstallContext): void
  25.     {
  26.         parent::uninstall($uninstallContext);
  27.         if ($uninstallContext->keepUserData()) {
  28.             return;
  29.         }
  30.         if (!$this->container instanceof ContainerInterface) {
  31.             return;
  32.         }
  33.         $connection $this->container->get(Connection::class);
  34.         if (null === $connection) {
  35.             return;
  36.         }
  37.         $connection->executeStatement('SET FOREIGN_KEY_CHECKS=0');
  38.         $connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_sales_channel`');
  39.         $connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_language`');
  40.         $connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_category`');
  41.         $connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_product`');
  42.         $connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_translation`');
  43.         $connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_schedule`');
  44.         $connection->executeStatement('DROP TABLE IF EXISTS `neti_modal`');
  45.         $connection->executeStatement('SET FOREIGN_KEY_CHECKS=1');
  46.     }
  47. }