Dispatches a new event to all configured listeners
The event key name or instance of EventInterface.
Returns a list of all listeners for an eventKey in the order they should be called
off(mixed $eventKey, mixed $callable)
Remove a listener from the active listeners.
Remove a EventListenerInterface entirely:
Remove all listeners for a given event:
Remove a specific listener:
Remove a callback from all events:
The event unique identifier name with which the callback has been associated, or the $listener you want to remove.
The callback you want to detach.
on(mixed $eventKey, mixed $options, ?callable $callable)
Adds a new listener to an event.
A variadic interface to add listeners that emulates jQuery.on().
Binding an EventListenerInterface:
Binding with no options:
Binding with options:
$eventManager->on('Model.beforeSave', ['priority' => 90], $callable);
The event unique identifier name with which the callback will be associated. If $eventKey is an instance of Cake\Event\EventListenerInterface its events will be bound using the
Either an array of options or the callable you wish to bind to $eventKey. If an array of options, the
priority key can be used to define the order. Priorities are treated as queues. Lower values are called before higher ones, and multiple attachments added to the same priority queue will be treated in the order of insertion.
The callable function you want invoked.
© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.