custom/plugins/LdsGPSR/src/LdsGPSR.php line 15

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