custom/plugins/OvrInformalGerman/src/OvrInformalGerman.php line 13

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace OvrInformalGerman;
  3. use OvrInformalGerman\Service\SnippetService;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  6. use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
  7. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  8. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  9. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  10. class OvrInformalGerman extends Plugin
  11. {
  12.     public function install(InstallContext $installContext): void
  13.     {
  14.         /**
  15.          * @var SnippetService $insertSnippetService
  16.          */
  17.         $snippetRepo $this->container->get('snippet.repository');
  18.         $snippetSetRepo $this->container->get('snippet_set.repository');
  19.         $snippetService = new SnippetService($snippetRepo$snippetSetRepo);
  20.         $snippetService->insert($installContext->getContext());
  21.         parent::install($installContext);
  22.     }
  23.     public function uninstall(UninstallContext $uninstallContext): void
  24.     {
  25.         $snippetRepo $this->container->get('snippet.repository');
  26.         $snippetSetRepo $this->container->get('snippet_set.repository');
  27.         $snippetService = new SnippetService($snippetRepo$snippetSetRepo);
  28.         $snippetService->remove($uninstallContext->getContext());
  29.         parent::uninstall($uninstallContext);
  30.     }
  31.     public function update(UpdateContext $updateContext): void
  32.     {
  33.         $snippetRepo $this->container->get('snippet.repository');
  34.         $snippetSetRepo $this->container->get('snippet_set.repository');
  35.         $snippetService = new SnippetService($snippetRepo$snippetSetRepo);
  36.         $snippetService->update($updateContext->getContext());
  37.         parent::update($updateContext);
  38.     }
  39. }