custom/plugins/NetiNextExportOnEvent/src/Subscriber/BusinessEventCollectorSubscriber.php line 20

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace NetInventors\NetiNextExportOnEvent\Subscriber;
  4. use NetInventors\NetiNextExportOnEvent\Services\Event\ExportOnEventAware;
  5. use Shopware\Core\Framework\Event\BusinessEventCollectorEvent;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. class BusinessEventCollectorSubscriber implements EventSubscriberInterface
  8. {
  9.     public static function getSubscribedEvents(): array
  10.     {
  11.         return [
  12.             BusinessEventCollectorEvent::NAME => 'addExportOnEventAware',
  13.         ];
  14.     }
  15.     public function addExportOnEventAware(BusinessEventCollectorEvent $event): void
  16.     {
  17.         foreach ($event->getCollection()->getElements() as $definition) {
  18.             $definition->addAware(ExportOnEventAware::class);
  19.         }
  20.     }
  21. }