<?php declare(strict_types=1);
namespace Dmits\PaymentCost;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Dmits\PaymentCost\Core\Content\PaymentCost\PaymentCostDefinition;
class DmitsPaymentCost extends Plugin
{
public function uninstall(UninstallContext $uninstallContext): void
{
if (!$uninstallContext->keepUserData()) {
try{
$this->container->get(Connection::class)->exec('DROP TABLE IF EXISTS '.PaymentCostDefinition::ENTITY_NAME.'');
} catch (OutOfBoundsException $e) {
$this->container->get(Connection::class)->exec('DROP TABLE IF EXISTS '.PaymentCostDefinition::ENTITY_NAME.'');
}
}
}
}