custom/plugins/MadYoutubeVideoOptions/src/MadYoutubeVideoOptions.php line 10

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace MadYoutubeVideoOptions;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  5. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  6. use MadYoutubeVideoOptions\Service\MadCustomFieldService;
  7. class MadYoutubeVideoOptions extends Plugin
  8. {
  9.     public const YOUTUBE_PRODUCT_EXTENSION_KEY 'mad_youtube_options';
  10.     public function install(InstallContext $installContext): void
  11.     {
  12.         $customFields = new MadCustomFieldService($this->container->get('custom_field_set.repository'));
  13.         $customFields->createFields($installContext);
  14.     }
  15.     public function uninstall(UninstallContext $uninstallContext): void{
  16.         $customFields = new MadCustomFieldService($this->container->get('custom_field_set.repository'));
  17.         $customFields->deleteFields($uninstallContext);
  18.     }
  19. }