custom/plugins/WbfkProductLinks/src/WbfkProductLinks.php line 12

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