<?php declare(strict_types=1);
namespace OvrInformalGerman;
use OvrInformalGerman\Service\SnippetService;
use Shopware\Core\Framework\Plugin;
use Shopware\Core\Framework\Plugin\Context\ActivateContext;
use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
class OvrInformalGerman extends Plugin
{
public function install(InstallContext $installContext): void
{
/**
* @var SnippetService $insertSnippetService
*/
$snippetRepo = $this->container->get('snippet.repository');
$snippetSetRepo = $this->container->get('snippet_set.repository');
$snippetService = new SnippetService($snippetRepo, $snippetSetRepo);
$snippetService->insert($installContext->getContext());
parent::install($installContext);
}
public function uninstall(UninstallContext $uninstallContext): void
{
$snippetRepo = $this->container->get('snippet.repository');
$snippetSetRepo = $this->container->get('snippet_set.repository');
$snippetService = new SnippetService($snippetRepo, $snippetSetRepo);
$snippetService->remove($uninstallContext->getContext());
parent::uninstall($uninstallContext);
}
public function update(UpdateContext $updateContext): void
{
$snippetRepo = $this->container->get('snippet.repository');
$snippetSetRepo = $this->container->get('snippet_set.repository');
$snippetService = new SnippetService($snippetRepo, $snippetSetRepo);
$snippetService->update($updateContext->getContext());
parent::update($updateContext);
}
}