custom/plugins/MadArticleCustomergroup/src/MadArticleCustomergroup.php line 12

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