PHP Class Prooph\ServiceBus\Plugin\MessageFactoryPlugin

This plugin listens on the MessageBus::EVENT_INITIALIZE action event. It checks if the message of the action event is given as an array and if the array contains a key "message_name". If both conditions are met the plugin uses the injected Prooph\Common\Messaging\MessageFactory to translate the message array into a Prooph\Common\Messaging\Message
Author: Alexander Miertsch ([email protected])
Inheritance: implements Prooph\Common\Event\ActionEventListenerAggregate, use trait Prooph\Common\Event\DetachAggregateHandlers
Show file Open project: prooph/service-bus

Public Methods

Method Description
__construct ( Prooph\Common\Messaging\MessageFactory $messageFactory )
__invoke ( Prooph\Common\Event\ActionEvent $actionEvent )
attach ( Prooph\Common\Event\ActionEventEmitter $dispatcher )

Method Details

__construct() public method

public __construct ( Prooph\Common\Messaging\MessageFactory $messageFactory )
$messageFactory Prooph\Common\Messaging\MessageFactory

__invoke() public method

public __invoke ( Prooph\Common\Event\ActionEvent $actionEvent )
$actionEvent Prooph\Common\Event\ActionEvent

attach() public method

public attach ( Prooph\Common\Event\ActionEventEmitter $dispatcher )
$dispatcher Prooph\Common\Event\ActionEventEmitter