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

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