<?php declare(strict_types=1);
/*
* (c) webpiloten. <kontakt@web-piloten.de>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Spno\ActivityLog;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Spno\ActivityLog\Framework\ActivityLog\Entity\ActivityLog\ActivityLogDefinition;
class SpnoActivityLog extends Plugin
{
public function uninstall(UninstallContext $uninstallContext): void
{
if ($uninstallContext->keepUserData()) {
parent::uninstall($uninstallContext);
return;
}
/** @var Connection $connection */
$connection = $this->container->get(Connection::class);
$entities = [
ActivityLogDefinition::ENTITY_NAME,
];
foreach ($entities as $entityName) {
$connection->executeStatement(\sprintf('DROP TABLE IF EXISTS `%s`', $entityName));
}
}
}