custom/plugins/WbfkBundles/src/WbfkBundles.php line 13

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Wbfk\Bundles;
  4. use Doctrine\DBAL\Connection;
  5. use Doctrine\DBAL\Exception;
  6. use Shopware\Core\Framework\Plugin;
  7. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  8. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  9. class WbfkBundles extends Plugin
  10. {
  11.     public function install(InstallContext $installContext): void
  12.     {
  13.     }
  14.     public function uninstall(UninstallContext $uninstallContext): void
  15.     {
  16.         parent::uninstall($uninstallContext);
  17.         if ($uninstallContext->keepUserData()) {
  18.             return;
  19.         }
  20.         /** @var Connection $connection */
  21.         $connection $this->container->get(Connection::class);
  22.         try {
  23.             $connection->executeStatement('DROP TABLE IF EXISTS `wbfk_bundle_product`');
  24.         } catch (Exception $e) {
  25.         }
  26.     }
  27. }