<?php
/**
* @category NetiNextModal
* @author bmueller
*/
namespace NetInventors\NetiNextModal;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DBALException;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Class NetiNextModal
*
* @package NetInventors\NetiNextModal
*/
class NetiNextModal extends Plugin
{
/**
* @param UninstallContext $uninstallContext
*
* @throws DBALException
*/
public function uninstall(UninstallContext $uninstallContext): void
{
parent::uninstall($uninstallContext);
if ($uninstallContext->keepUserData()) {
return;
}
if (!$this->container instanceof ContainerInterface) {
return;
}
$connection = $this->container->get(Connection::class);
if (null === $connection) {
return;
}
$connection->executeStatement('SET FOREIGN_KEY_CHECKS=0');
$connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_sales_channel`');
$connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_language`');
$connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_category`');
$connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_product`');
$connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_translation`');
$connection->executeStatement('DROP TABLE IF EXISTS `neti_modal_schedule`');
$connection->executeStatement('DROP TABLE IF EXISTS `neti_modal`');
$connection->executeStatement('SET FOREIGN_KEY_CHECKS=1');
}
}