vendor/lnb/shopware6-lnb-product-review/src/LnbProductReview.php line 12

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Lnb\Shopware6\LnbProductReview;
  4. use Doctrine\DBAL\Connection;
  5. use Lnb\Shopware6\LnbProductReview\Extension\Content\Product\Aggregate\ProductReviewExtensionDefinition;
  6. use Shopware\Core\Framework\Plugin;
  7. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  8. class LnbProductReview extends Plugin
  9. {
  10.     public function uninstall(UninstallContext $uninstallContext): void
  11.     {
  12.         if ($uninstallContext->keepUserData()) {
  13.             return;
  14.         }
  15.         $classNames = [ProductReviewExtensionDefinition::ENTITY_NAME];
  16.         if (!$this->container) {
  17.             return;
  18.         }
  19.         /** @var Connection $connection */
  20.         $connection $this->container->get(Connection::class);
  21.         foreach ($classNames as $className) {
  22.             $connection->executeStatement(sprintf('DROP TABLE IF EXISTS `%s`'$className));
  23.         }
  24.     }
  25. }