Interface for shared event listener collections

 Methods

Attach a listener to an event

attach(string | array $id, string $event, \Zend\EventManager\callable $callback, int $priority) : void

Parameters

$id

stringarray

Identifier(s) for event emitting component(s)

$event

string

$callback

\Zend\EventManager\callable

PHP Callback

$priority

int

Priority at which listener should execute

Clear all listeners for a given identifier, optionally for a specific event

clearListeners(string | int $id, null | string $event) : bool

Parameters

$id

stringint

$event

nullstring

Returns

bool

Detach a listener from an event offered by a given resource

detach(string | int $id, \Zend\Stdlib\CallbackHandler $listener) : bool

Parameters

$id

stringint

Returns

boolReturns true if event and listener found, and unsubscribed; returns false if either event or listener not found

Retrieve all registered events for a given resource

getEvents(string | int $id) : array

Parameters

$id

stringint

Returns

array

Retrieve all listeners for a given identifier and event

getListeners(string | int $id, string | int $event) : false | \Zend\Stdlib\PriorityQueue

Parameters

$id

stringint

$event

stringint

Returns