custom/plugins/PremsWishlist/src/PremsWishlist.php line 19

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4.  * PremSoft
  5.  * Copyright © 2019 Premsoft - Sven Mittreiter
  6.  *
  7.  * @copyright  Copyright (c) 2019, premsoft - Sven Mittreiter (http://www.premsoft.de)
  8.  * @author     Sven Mittreiter <info@premsoft.de>
  9.  */
  10. namespace Prems\Plugin\PremsWishlist;
  11. use Doctrine\DBAL\Connection;
  12. use Prems\Plugin\PremsWishlist\ScheduledTask\CleanupWishlistsTask;
  13. use Shopware\Core\Framework\Plugin;
  14. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  15. class PremsWishlist extends Plugin
  16. {
  17.     public function uninstall(UninstallContext $context): void
  18.     {
  19.         parent::uninstall($context);
  20.         if ($context->keepUserData()) {
  21.             return;
  22.         }
  23.         $connection $this->container->get(Connection::class);
  24.         $connection->executeStatement('DROP TABLE IF EXISTS `prems_wishlist_product`');
  25.         $connection->executeStatement('DROP TABLE IF EXISTS `prems_wishlist`');
  26.         $connection->executeStatement('DELETE FROM scheduled_task where `name` = ?', [CleanupWishlistsTask::getTaskName()]);
  27.     }
  28. }