custom/plugins/SwagFlowBuilder/src/Core/Content/Flow/Subscriber/BusinessEventCollectorSubscriber.php line 23

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. /*
  3.  * (c) shopware AG <info@shopware.com>
  4.  * For the full copyright and license information, please view the LICENSE
  5.  * file that was distributed with this source code.
  6.  */
  7. namespace Swag\FlowBuilderProfessional\Core\Content\Flow\Subscriber;
  8. use Shopware\Core\Framework\Event\BusinessEventCollectorEvent;
  9. use Swag\FlowBuilderProfessional\Core\Framework\Event\WebhookAware;
  10. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  11. class BusinessEventCollectorSubscriber implements EventSubscriberInterface
  12. {
  13.     public static function getSubscribedEvents()
  14.     {
  15.         return [
  16.             BusinessEventCollectorEvent::NAME => 'addWebhookAware',
  17.         ];
  18.     }
  19.     public function addWebhookAware(BusinessEventCollectorEvent $event): void
  20.     {
  21.         foreach ($event->getCollection()->getElements() as $definition) {
  22.             $definition->addAware(WebhookAware::class);
  23.         }
  24.     }
  25. }