EventManagerAwareTrait

A trait for objects that provide events. If you use this trait in an object, you will probably want to also implement EventManagerAwareInterface, which will make it so the default initializer in a ZF2 MVC application will automatically inject an instance of the EventManager into your object when it is pulled from the ServiceManager.

Known Users

Omeka\Api\Adapter\AbstractAdapter, Omeka\Api\Representation\AbstractRepresentation, Omeka\ServiceManager\AbstractPluginManager
Zend\Mvc\Service\ServiceManagerConfig
Open source code
Methods Summary
public
# setEventManager( Zend\EventManager\EventManagerInterface $events )
Set the event manager instance used by this context. For convenience, this method will also set the class name / LSB name as identifiers, in addition to any string or array of strings set to the $this->eventIdentifier property.
public
# getEventManager( )
Retrieve the event manager Lazy-loads an EventManager instance if none registered.
Properties Summary
protected Zend\EventManager\EventManagerInterface $events
Zend\Mvc\Service\ServiceManagerConfig
# NULL