Interface for messengers

package Default
inherited_from \Zend\EventManager\SharedEventManagerAwareInterface

 Methods

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

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

Parameters

$identifiers

stringintegerarray\Traversable

Returns

\Zend\EventManager\EventManagerInterface

Attach a listener to an event

attach(string $event, callable $callback = null, integer $priority = 1) : \Zend\Stdlib\CallbackHandler

Parameters

$event

string

$callback

callable

$priority

integer

Priority at which to register listener

Returns

\Zend\Stdlib\CallbackHandler

Attach a listener aggregate

attachAggregate(\Zend\EventManager\ListenerAggregateInterface $aggregate, integer $priority = 1) : mixed

Parameters

$aggregate

\Zend\EventManager\ListenerAggregateInterface

$priority

integer

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 an event listener

detach(\Zend\Stdlib\CallbackHandler|\Zend\EventManager\ListenerAggregateInterface $listener) : boolean

Parameters

$listener

\Zend\Stdlib\CallbackHandler\Zend\EventManager\ListenerAggregateInterface

Returns

boolean

Detach a listener aggregate

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

Parameters

$aggregate

\Zend\EventManager\ListenerAggregateInterface

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

\Zend\EventManager\EventManagerInterface

Set the identifiers (overrides any currently set identifiers)

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

Parameters

$identifiers

stringintegerarray\Traversable

Returns

\Zend\EventManager\EventManagerInterface

Trigger an event

trigger(string|\Zend\EventManager\EventInterface $event, object|string $target = null, array|object $argv = array(), null|callable $callback = null) : \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
  • Passing event name, target, array|ArrayAccess of arguments, and callback

Parameters

$event

string\Zend\EventManager\EventInterface

$target

objectstring

$argv

arrayobject

$callback

nullcallable

Returns

\Zend\EventManager\ResponseCollection

Trigger an event until the given callback returns a boolean true

triggerUntil(string|\Zend\EventManager\EventInterface $event, object|string $target, array|object $argv = null, callable $callback = null) : \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
deprecated Please use trigger()

Parameters

$event

string\Zend\EventManager\EventInterface

$target

objectstring

$argv

arrayobject

$callback

callable

Returns

\Zend\EventManager\ResponseCollection