<?php declare(strict_types=1);
namespace Swkweb\BuyXPayY;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
final class SwkwebBuyXPayY extends Plugin
{
public function uninstall(UninstallContext $uninstallContext): void
{
if ($uninstallContext->keepUserData()) {
return;
}
$this->dropSchema();
}
private function dropSchema(): void
{
/** @var Connection $connection */
$connection = $this->container->get(Connection::class);
$connection->executeUpdate('DROP TABLE IF EXISTS swkweb_buy_x_pay_y_promotion_translation');
$connection->executeUpdate('DROP TABLE IF EXISTS swkweb_buy_x_pay_y_promotion');
}
}