<?php declare(strict_types=1);
namespace LdsGPSR;
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;
use LdsGPSR\Installer\CustomFieldsInstaller;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
class LdsGPSR extends Plugin
{
public function install(InstallContext $installContext): void
{
(new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->install($installContext);
}
protected function getCustomFieldSetRepo(): EntityRepository
{
return $this->container->get('custom_field_set.repository');
}
public function update(UpdateContext $updateContext): void
{
(new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->update($updateContext);
}
public function uninstall(UninstallContext $uninstallContext): void
{
(new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->uninstall($uninstallContext);
}
public function activate(ActivateContext $activateContext): void
{
(new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->activate($activateContext);
}
public function deactivate(DeactivateContext $deactivateContext): void
{
(new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->deactivate($deactivateContext);
}
}