custom/plugins/DmSortingEnhancements/src/DmSortingEnhancements.php line 14

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Dm\SortingEnhancements;
  3. use Dm\SortingEnhancements\Installer\CustomFieldsInstaller;
  4. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
  5. use Shopware\Core\Framework\Plugin;
  6. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  7. use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
  8. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  9. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  10. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  11. class DmSortingEnhancements extends Plugin
  12. {
  13.     public function install(InstallContext $installContext): void
  14.     {
  15.         (new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->install($installContext);
  16.     }
  17.     protected function getCustomFieldSetRepo(): EntityRepositoryInterface
  18.     {
  19.         return $this->container->get('custom_field_set.repository');
  20.     }
  21.     public function update(UpdateContext $updateContext): void
  22.     {
  23.         (new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->update($updateContext);
  24.     }
  25.     public function uninstall(UninstallContext $uninstallContext): void
  26.     {
  27.         (new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->uninstall($uninstallContext);
  28.     }
  29.     public function activate(ActivateContext $activateContext): void
  30.     {
  31.         (new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->activate($activateContext);
  32.     }
  33.     public function deactivate(DeactivateContext $deactivateContext): void
  34.     {
  35.         (new CustomFieldsInstaller($this->getCustomFieldSetRepo()))->deactivate($deactivateContext);
  36.     }
  37. }