<?php declare(strict_types=1);
namespace Gshop\ConsentMode;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
class GshopConsentMode extends Plugin
{
public function uninstall(UninstallContext $uninstallContext): void
{
parent::uninstall($uninstallContext);
if ($uninstallContext->keepUserData()) {
return;
}
/** @var Connection $connection */
$connection = $this->container->get('Doctrine\DBAL\Connection');
foreach ($uninstallContext->getMigrationCollection()->getMigrationSteps() as $migrationStep) {
$migrationStep->updateDestructive($connection);
}
$this->removeMigrations();
}
}