PHP Class Mongolid\Event\EventTriggerService

Afficher le fichier Open project: leroy-merlin-br/mongolid Class Usage Examples

Protected Properties

Свойство Type Description
$dispatcher Mongolid\Event\EventTriggerInterface The one who are going to actually trigger the events to the rest of the application.

Méthodes publiques

Méthode Description
fire ( string $event, mixed $payload, boolean $halt = false ) : mixed Triggers / Dispatches a new event to the registered event handlers if they have been registered.
registerEventDispatcher ( Mongolid\Event\EventTriggerInterface $dispatcher ) : void Registers a object that will have the responsibility of firing events to the rest of the application.

Method Details

fire() public méthode

Triggers / Dispatches a new event to the registered event handlers if they have been registered.
public fire ( string $event, mixed $payload, boolean $halt = false ) : mixed
$event string Identification of the event.
$payload mixed Data that is going to be sent to the event handler.
$halt boolean The output of the event handler will be used in a conditional inside the context of where the event is being fired. This means that, if the event handler returns false, it will probably stop the action being executed, for example, "saving".
Résultat mixed Event handler return. The importance of this return is determined by $halt

registerEventDispatcher() public méthode

Registers a object that will have the responsibility of firing events to the rest of the application.
public registerEventDispatcher ( Mongolid\Event\EventTriggerInterface $dispatcher ) : void
$dispatcher Mongolid\Event\EventTriggerInterface Event trigger object.
Résultat void

Property Details

$dispatcher protected_oe property

The one who are going to actually trigger the events to the rest of the application.
protected EventTriggerInterface,Mongolid\Event $dispatcher
Résultat Mongolid\Event\EventTriggerInterface