custom/plugins/ProcWegmannThemeExtend/src/Decorator/Core/Flow/BusinessEventCollectorSubscriber.php line 33

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace ProclaneWegmannThemeExtend\Decorator\Core\Flow;
  3. use Shopware\Core\Framework\Event\BusinessEventCollector;
  4. use Shopware\Core\Framework\Event\BusinessEventCollectorEvent;
  5. use Shopware\Core\Framework\Log\Package;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. use ProclaneWegmannThemeExtend\Decorator\Core\Checkout\Customer\SalesChannel\CustomerAccountRecoverRequestFrontendEvent;
  8. use Shopware\Core\Framework\Event\BusinessEventDefinition;
  9. /**
  10.  * @internal
  11.  */
  12. #[Package('checkout')]
  13. class BusinessEventCollectorSubscriber implements EventSubscriberInterface
  14. {
  15.     public function __construct(private readonly BusinessEventCollector $businessEventCollector)
  16.     {
  17.     }
  18.     /**
  19.      * @return array<string, string|array{0: string, 1: int}|list<array{0: string, 1?: int}>>
  20.      */
  21.     public static function getSubscribedEvents(): array
  22.     {
  23.         return [
  24.             BusinessEventCollectorEvent::NAME => ['onAddEvent'1000],
  25.         ];
  26.     }
  27.     public function onAddEvent(BusinessEventCollectorEvent $event): void
  28.     {
  29.         $collection $event->getCollection();
  30.         
  31.         $definition $this->businessEventCollector->define(CustomerAccountRecoverRequestFrontendEvent::class);
  32.         if (!$definition) {
  33.             return;
  34.         }
  35.         $collection->set($definition->getName(), $definition);
  36.        
  37.     }
  38. }