vendor/store.shopware.com/meteorpromotiongift/src/MeteorPromotionGift.php line 9

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace Meteor\PromotionGift;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. class MeteorPromotionGift extends Plugin
  7. {
  8.     public function uninstall(UninstallContext $uninstallContext): void
  9.     {
  10.         if ($uninstallContext->keepUserData()) {
  11.             return;
  12.         }
  13.         $this->runDestructiveMigrations($uninstallContext);
  14.     }
  15.     private function runDestructiveMigrations(UninstallContext $uninstallContext): void
  16.     {
  17.         $connection $this->container->get(\Doctrine\DBAL\Connection::class);
  18.         $connection->executeQuery('SET FOREIGN_KEY_CHECKS=0;');
  19.         foreach ($uninstallContext->getMigrationCollection()->getMigrationSteps() as $migration) {
  20.             try {
  21.                 $migration->updateDestructive($connection);
  22.             } catch (\Exception $ex) {
  23.                 // ignore
  24.             }
  25.         }
  26.         $connection->executeQuery('SET FOREIGN_KEY_CHECKS=1;');
  27.     }
  28. }