<?php declare(strict_types=1);
namespace CoeBasketOfferSw6;
use CoeBasketOfferSw6\Offer\OfferDefinition;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
class CoeBasketOfferSw6 extends Plugin {
public function uninstall(UninstallContext $uninstallContext): void {
if($uninstallContext->keepUserData()){
return;
}
/** @var Connection $connection */
$connection = $this->container->get('Doctrine\DBAL\Connection');
$tables = [
OfferDefinition::ENTITY_NAME
];
foreach ($tables as $table) {
$connection->executeStatement(\sprintf('DROP TABLE IF EXISTS `%s`', $table));
}
$connection->executeStatement("DELETE FROM `mail_template_type` WHERE technical_name='coe_offer_form'");
}
}