custom/plugins/VioB2BBudgets/src/VioB2BBudgets.php line 9

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