<?php declare(strict_types=1);
namespace Dm\SortingEnhancements;
use Dm\SortingEnhancements\Installer\CustomFieldsInstaller;
use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
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 DmSortingEnhancements extends Plugin
{
public function install(InstallContext $installContext): void
{
(new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->install($installContext);
}
protected function getCustomFieldSetRepo(): EntityRepositoryInterface
{
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);
}
}