custom/plugins/CioSponsoredOrderConfirmation/src/Subscriber/BusinessEventSubscriber.php line 21

Open in your IDE?
  1. <?php
  2. namespace CioSponsoredOrderConfirmation\Subscriber;
  3. use CioSponsoredOrderConfirmation\Event\SponsoredAwaitReleaseInformCustomerEvent;
  4. use CioSponsoredOrderConfirmation\Event\SponsoredCancelledEvent;
  5. use CioSponsoredOrderConfirmation\Event\SponsoredReleasedEvent;
  6. use Shopware\Core\Framework\Event\BusinessEventCollectorEvent;
  7. use Shopware\Core\Framework\Event\BusinessEventDefinition;
  8. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  9. class BusinessEventSubscriber implements EventSubscriberInterface
  10. {
  11.     public static function getSubscribedEvents()
  12.     {
  13.         return [
  14.             'collect.business-events' => 'onBusinessEvent'
  15.         ];
  16.     }
  17.     public function onBusinessEvent(BusinessEventCollectorEvent $event)
  18.     {
  19.         $businessEventsCollection $event->getCollection();
  20.         $businessEventsCollection->add(new BusinessEventDefinition(
  21.             SponsoredAwaitReleaseInformCustomerEvent::EVENT_NAME,
  22.             SponsoredAwaitReleaseInformCustomerEvent::class,
  23.             true,
  24.             false,
  25.             false,
  26.             []
  27.         ));
  28.         $businessEventsCollection->add(new BusinessEventDefinition(
  29.             SponsoredReleasedEvent::EVENT_NAME,
  30.             SponsoredReleasedEvent::class,
  31.             true,
  32.             false,
  33.             false,
  34.             []
  35.         ));
  36.         $businessEventsCollection->add(new BusinessEventDefinition(
  37.             SponsoredCancelledEvent::EVENT_NAME,
  38.             SponsoredCancelledEvent::class,
  39.             true,
  40.             false,
  41.             false,
  42.             []
  43.         ));
  44.     }
  45. }