custom/plugins/GbmedClientPentagastAktionenSlider/src/GbmedClientPentagastAktionenSlider.php line 25

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /**
  3.  * gb media
  4.  * All Rights Reserved.
  5.  *
  6.  * Unauthorized copying of this file, via any medium is strictly prohibited.
  7.  * The content of this file is proprietary and confidential.
  8.  *
  9.  * @category       Shopware
  10.  * @package        Shopware_Plugins
  11.  * @subpackage     GbmedClientPentagastAktionenSlider
  12.  * @copyright      Copyright (c) 2023, gb media
  13.  * @license        proprietary
  14.  * @author         Giuseppe Bottino
  15.  * @link           http://www.gb-media.biz
  16.  */
  17. namespace Gbmed\ClientPentagastAktionenSlider;
  18. use Doctrine\DBAL\Connection;
  19. use Doctrine\DBAL\DBALException;
  20. use Shopware\Core\Framework\Plugin;
  21. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  22. class GbmedClientPentagastAktionenSlider extends Plugin
  23. {
  24.     /**
  25.      * removing the plugin data
  26.      *
  27.      * @param UninstallContext $context
  28.      *
  29.      * @throws DBALException
  30.      * @throws \Shopware\Core\Framework\DataAbstractionLayer\Exception\InconsistentCriteriaIdsException
  31.      */
  32.     public function uninstall(UninstallContext $context): void
  33.     {
  34.         if ($context->keepUserData()) {
  35.             return;
  36.         }
  37.         try {
  38.             $sql file_get_contents(__DIR__ '/Resources/sql/drop.sql');
  39.             $this->container->get(Connection::class)->executeStatement($sql);
  40.         } catch (\Exception $e) {
  41.         }
  42.     }
  43. }