Prooph\ServiceBus\Plugin\Router\EventRouter::onRouteEvent PHP Méthode

onRouteEvent() public méthode

Deprecation: Will be removed with v6.0, use method onRouteMessage instead
public onRouteEvent ( Prooph\Common\Event\ActionEvent $actionEvent )
$actionEvent Prooph\Common\Event\ActionEvent
    public function onRouteEvent(ActionEvent $actionEvent)
    {
        $this->onRouteMessage($actionEvent);
    }

Usage Example

 /**
  * @test
  */
 public function it_still_works_if_deprecated_method_on_route_event_is_used()
 {
     $router = new EventRouter(['SomethingDone' => ['SomethingDoneListener1', 'SomethingDoneListener2']]);
     $actionEvent = new DefaultActionEvent(MessageBus::EVENT_ROUTE, new EventBus(), [MessageBus::EVENT_PARAM_MESSAGE_NAME => 'SomethingDone']);
     $router->onRouteEvent($actionEvent);
     $this->assertEquals("SomethingDoneListener1", $actionEvent->getParam(EventBus::EVENT_PARAM_EVENT_LISTENERS)[0]);
     $this->assertEquals("SomethingDoneListener2", $actionEvent->getParam(EventBus::EVENT_PARAM_EVENT_LISTENERS)[1]);
 }
All Usage Examples Of Prooph\ServiceBus\Plugin\Router\EventRouter::onRouteEvent