<?php declare(strict_types=1);
namespace Swkweb\ProductSet;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
class SwkwebProductSet extends Plugin
{
public function uninstall(UninstallContext $uninstallContext): void
{
if ($uninstallContext->keepUserData()) {
return;
}
$this->dropSchema();
}
private function dropSchema(): void
{
/** @var Connection */
$connection = $this->container->get(Connection::class);
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_slot_assignment;');
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_option_translation;');
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_option;');
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_slot_translation;');
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_slot;');
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_price_calculation;');
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_product;');
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set_translation;');
$connection->executeStatement('DROP TABLE IF EXISTS swkweb_product_set;');
}
}