\Piko\EventHandlerTrait
An instance using this trait become an event handler : it can dispatches events and listen to them.
Properties summary
Name | Description |
---|---|
protected $eventDispatcher |
|
protected $listenerProvider |
Methods summary
Name | Description |
---|---|
public on |
|
public trigger |
Trigger an event that may be listen by event liste… |
Properties
protected $eventDispatcher : \Psr\EventDispatcher\EventDispatcherInterface
protected $listenerProvider : \Piko\ListenerProvider
Methods
public on(): mixed
public on(mixed $eventClassName, callable $callback, ?int $priority = null): mixed
Parameters
$eventClassName :
$callback :
$priority (default: null):
Return:
mixed
public trigger(): object
public trigger(object $event): object
Trigger an event that may be listen by event listeners.
Parameters
$event : The event instance to dispatch.
Return:
object The same event instance that may be altered by event listeners.