Zend Framework  3.0
Public Member Functions | List of all members
ListenerAggregateInterface Interface Reference

Interface for self-registering event listeners. More...

Public Member Functions

 attach (EventManagerInterface $events, $priority=1)
 Attach one or more listeners.
 
 detach (EventManagerInterface $events)
 Detach all previously attached listeners.
 

Detailed Description

Interface for self-registering event listeners.

Classes implementing this interface may be registered by name or instance with an EventManager, without an event name. The attach() method will then be called with the current EventManager instance, allowing the class to wire up one or more listeners.

Member Function Documentation

attach ( EventManagerInterface  $events,
  $priority = 1 
)
detach ( EventManagerInterface  $events)

Detach all previously attached listeners.

Parameters
EventManagerInterface$events
Returns
void

Implemented in ServiceListener, ModuleLoaderListener, DefaultListenerAggregate, and AbstractListenerAggregate.