Interface for messengers

category Zend
package Zend_EventManager

 Methods

Add some identifier(s) (appends to any currently set identifiers)

addIdentifiers(string | int | array | \Traversable $identifiers) : \Zend\EventManager\EventManagerInterface

Parameters

$identifiers

stringintarray\Traversable

Returns

Attach a listener to an event

attach(string $event, \Zend\EventManager\callable $callback, int $priority) : \Zend\Stdlib\CallbackHandler

Parameters

$event

string

$callback

\Zend\EventManager\callable

$priority

int

Priority at which to register listener

Returns

Attach a listener aggregate

attachAggregate(\Zend\EventManager\ListenerAggregateInterface $aggregate, int $priority) : mixed

Parameters

$priority

int

If provided, a suggested priority for the aggregate to use

Returns

mixedreturn value of {@link ListenerAggregateInterface::attach()}

Clear all listeners for a given event

clearListeners(string $event) : void

Parameters

$event

string

Detach a listener aggregate

detachAggregate(\Zend\EventManager\ListenerAggregateInterface $aggregate) : mixed

Parameters

Returns

mixedreturn value of {@link ListenerAggregateInterface::detach()}

Get a list of events for which this collection has listeners

getEvents() : array

Returns

array

Get the identifier(s) for this EventManager

getIdentifiers() : array

Returns

array

Retrieve a list of listeners registered to a given event

getListeners(string $event) : array | object

Parameters

$event

string

Returns

arrayobject

Set the event class to utilize

setEventClass(string $class) : \Zend\EventManager\EventManagerInterface

Parameters

$class

string

Returns

Set the identifiers (overrides any currently set identifiers)

setIdentifiers(string | int | array | \Traversable $identifiers) : \Zend\EventManager\EventManagerInterface

Parameters

$identifiers

stringintarray\Traversable

Returns

Trigger an event

trigger(string $event, object | string $target, array | object $argv, null | \Zend\EventManager\callable $callback) : \Zend\EventManager\ResponseCollection

Should allow handling the following scenarios: - Passing Event object only - Passing event name and Event object only - Passing event name, target, and Event object - Passing event name, target, and array|ArrayAccess of arguments

Can emulate triggerUntil() if the last argument provided is a callback.

Parameters

$event

string

$target

objectstring

$argv

arrayobject

$callback

null\Zend\EventManager\callable

Returns

Trigger an event until the given callback returns a boolean false

triggerUntil(string $event, object | string $target, array | object $argv, \Zend\EventManager\callable $callback) : \Zend\EventManager\ResponseCollection

Should allow handling the following scenarios: - Passing Event object and callback only - Passing event name, Event object, and callback only - Passing event name, target, Event object, and callback - Passing event name, target, array|ArrayAccess of arguments, and callback

Parameters

$event

string

$target

objectstring

$argv

arrayobject

$callback

\Zend\EventManager\callable

Returns