custom/plugins/KzphLastchange/src/KzphLastchange.php line 10

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Kzph\Lastchange;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. use Doctrine\DBAL\Connection;
  7. class KzphLastchange extends Plugin
  8. {
  9.     public function uninstall(UninstallContext $context): void
  10.     {
  11.         parent::uninstall($context);
  12.         if ($context->keepUserData()) {
  13.             return;
  14.         }
  15.         $this->dropDatabaseTables();
  16.     }
  17.     private function dropDatabaseTables(): void
  18.     {
  19.         $connection $this->container->get(Connection::class);
  20.         $connection->executeStatement('DROP TABLE IF EXISTS `kzph_lastchange`');
  21.     }
  22. }