custom/plugins/TomRocketsTheme/src/TomRockets.php line 12

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace TomRockets;
  3. use Shopware\Core\Framework\Context;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  6. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  7. use Shopware\Storefront\Framework\ThemeInterface;
  8. use TomRockets\Service\CustomFieldsetsService;
  9. class TomRockets extends Plugin implements ThemeInterface
  10. {
  11.     public function install(InstallContext $installContext): void
  12.     {
  13.         parent::install($installContext);
  14.         (new CustomFieldsetsService(
  15.             $this->container->get('custom_field_set.repository'),
  16.             Context::createDefaultContext()
  17.         ))->create();
  18.     }
  19.     public function uninstall(UninstallContext $uninstallContext): void
  20.     {
  21.         parent::uninstall($uninstallContext);
  22.         (new CustomFieldsetsService(
  23.             $this->container->get('custom_field_set.repository'),
  24.             $uninstallContext->getContext()
  25.         ))->remove();
  26.     }
  27. }