custom/plugins/DmitsPaymentCost/src/DmitsPaymentCost.php line 10

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Dmits\PaymentCost;
  3. use Doctrine\DBAL\Connection;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. use Dmits\PaymentCost\Core\Content\PaymentCost\PaymentCostDefinition;
  7. class DmitsPaymentCost extends Plugin
  8. {
  9.     public function uninstall(UninstallContext $uninstallContext): void
  10.     {
  11.         if (!$uninstallContext->keepUserData()) {
  12.             try{
  13.                 $this->container->get(Connection::class)->exec('DROP TABLE IF EXISTS '.PaymentCostDefinition::ENTITY_NAME.'');
  14.             } catch (OutOfBoundsException $e) {
  15.                 $this->container->get(Connection::class)->exec('DROP TABLE IF EXISTS '.PaymentCostDefinition::ENTITY_NAME.'');
  16.             }
  17.         }
  18.     }
  19. }