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

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace FuerstenbergPorzellan;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Storefront\Framework\ThemeInterface;
  5. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  6. use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
  7. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  8. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  9. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  10. use FuerstenbergPorzellan\Installer\CustomFieldsInstaller;
  11. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepository;
  12. class FuerstenbergPorzellan extends Plugin implements ThemeInterface
  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. }