custom/plugins/McsExportAccounting/src/McsExportAccounting.php line 11

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace Mcs\ExportAccounting;
  3. use Mcs\ExportAccounting\Service\StatisticsProductGroupService;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  6. use Shopware\Core\Framework\Plugin\Context\DeactivateContext;
  7. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  8. class McsExportAccounting extends Plugin
  9. {
  10.     public function activate(ActivateContext $context): void
  11.     {
  12.         parent::activate($context);
  13.         // Register custom fields
  14.         $customFieldService = new StatisticsProductGroupService($this->container);
  15.         $customFieldService->addCustomFields($context->getContext());
  16.     }
  17.     public function deactivate(DeactivateContext $context): void
  18.     {
  19.         parent::deactivate($context);
  20.         // Unregister custom fields
  21.         $customFieldService = new StatisticsProductGroupService($this->container);
  22.         $customFieldService->removeCustomFields($context->getContext());
  23.     }
  24. }