custom/static-plugins/CioFormBuilder/src/Subscriber/BusinessEventSubscriber.php line 23

Open in your IDE?
  1. <?php
  2. namespace CioFormBuilder\Subscriber;
  3. use CioFormBuilder\Event\EventAwaitReleaseInformCustomerEvent;
  4. use CioFormBuilder\Event\EventAwaitReleaseInformReleaserEvent;
  5. use CioFormBuilder\Event\EventCancelledEvent;
  6. use CioFormBuilder\Event\EventReleasedEvent;
  7. use CioFormBuilder\Event\EventReleasedManufacturerEvent;
  8. use Shopware\Core\Framework\Event\BusinessEventCollectorEvent;
  9. use Shopware\Core\Framework\Event\BusinessEventDefinition;
  10. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  11. class BusinessEventSubscriber implements EventSubscriberInterface
  12. {
  13.     public static function getSubscribedEvents()
  14.     {
  15.         return [
  16.             'collect.business-events' => 'onBusinessEvent'
  17.         ];
  18.     }
  19.     public function onBusinessEvent(BusinessEventCollectorEvent $event)
  20.     {
  21.         $businessEventsCollection $event->getCollection();
  22.         $businessEventsCollection->add(new BusinessEventDefinition(
  23.             EventAwaitReleaseInformCustomerEvent::EVENT_NAME,
  24.             EventAwaitReleaseInformCustomerEvent::class,
  25.             true,
  26.             false,
  27.             false,
  28.             []
  29.         ));
  30.         $businessEventsCollection->add(new BusinessEventDefinition(
  31.             EventAwaitReleaseInformReleaserEvent::EVENT_NAME,
  32.             EventAwaitReleaseInformReleaserEvent::class,
  33.             true,
  34.             false,
  35.             false,
  36.             []
  37.         ));
  38.         $businessEventsCollection->add(new BusinessEventDefinition(
  39.             EventReleasedEvent::EVENT_NAME,
  40.             EventReleasedEvent::class,
  41.             true,
  42.             false,
  43.             false,
  44.             []
  45.         ));
  46.         $businessEventsCollection->add(new BusinessEventDefinition(
  47.             EventReleasedManufacturerEvent::EVENT_NAME,
  48.             EventReleasedManufacturerEvent::class,
  49.             true,
  50.             false,
  51.             false,
  52.             []
  53.         ));
  54.         $businessEventsCollection->add(new BusinessEventDefinition(
  55.             EventCancelledEvent::EVENT_NAME,
  56.             EventCancelledEvent::class,
  57.             true,
  58.             false,
  59.             false,
  60.             []
  61.         ));
  62.     }
  63. }