custom/plugins/GbmedCustomFieldsFilter/src/GbmedCustomFieldsFilter.php line 26

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     GbmedCustomFieldsFilter
  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\CustomFieldsFilter;
  18. use Gbmed\CustomFieldsFilter\Installer\Installer;
  19. use Doctrine\DBAL\Connection;
  20. use Exception as DBALException;
  21. use Shopware\Core\Framework\Plugin;
  22. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  23. class GbmedCustomFieldsFilter extends Plugin
  24. {
  25.     /**
  26.      * removing the plugin data
  27.      *
  28.      * @param UninstallContext $context
  29.      *
  30.      * @throws DBALException
  31.      */
  32.     public function uninstall(UninstallContext $context): void
  33.     {
  34.         $this->getInstaller()->uninstall($context);
  35.         parent::uninstall($context);
  36.     }
  37.     /**
  38.      * return Installer instance
  39.      *
  40.      * @return Installer
  41.      */
  42.     private function getInstaller(): Installer
  43.     {
  44.         return new Installer(
  45.             $this->container->get(Connection::class)
  46.         );
  47.     }
  48. }