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

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /**
  3.  * LeopardSearchExtension
  4.  * Copyright (c) Die Leoparden GmbH
  5.  */
  6. namespace LeopardSearchExtension;
  7. use LeopardSearchExtension\Util\Lifecycle\InstallUninstall;
  8. use LeopardSearchExtension\Util\Lifecycle\Update;
  9. use Shopware\Core\Framework\Plugin;
  10. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  11. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  12. use Shopware\Core\System\SystemConfig\SystemConfigService;
  13. /**
  14.  * Class LeopardSearchExtension
  15.  */
  16. class LeopardSearchExtension extends Plugin
  17. {
  18.     /**
  19.      * @param InstallContext $installContext
  20.      * @return void
  21.      */
  22.     public function postInstall(InstallContext $installContext): void
  23.     {
  24.         (new InstallUninstall(
  25.             $this->getSystemConfigService()
  26.         ))->postInstall();
  27.     }
  28.     /**
  29.      * @param UpdateContext $updateContext
  30.      * @return void
  31.      */
  32.     public function postUpdate(UpdateContext $updateContext): void
  33.     {
  34.         (new Update(
  35.             $this->getSystemConfigService()
  36.         ))->postUpdate();
  37.     }
  38.     /**
  39.      * @return SystemConfigService
  40.      */
  41.     protected function getSystemConfigService(): SystemConfigService
  42.     {
  43.         return $this->container->get('Shopware\Core\System\SystemConfig\SystemConfigService');
  44.     }
  45. }