[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Source view] [Print] [Project Stats]
Zend Framework (http://framework.zend.com/)
Copyright: | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
License: | https://github.com/zendframework/zend-eventmanager/blob/master/LICENSE.md |
File Size: | 235 lines (9 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
SharedEventManager:: (4 methods):
attach()
detach()
getListeners()
clearListeners()
Class: SharedEventManager - X-Ref
Shared/contextual EventManagerattach($identifier, $event, callable $listener, $priority = 1) X-Ref |
Attach a listener to an event emitted by components with specific identifiers. Allows attaching a listener to an event offered by an identifying components. As an example, the following connects to the "getAll" event of both an AbstractResource and EntityResource: <code> $sharedEventManager = new SharedEventManager(); foreach (['My\Resource\AbstractResource', 'My\Resource\EntityResource'] as $identifier) { $sharedEventManager->attach( $identifier, 'getAll', function ($e) use ($cache) { if (!$id = $e->getParam('id', false)) { return; } if (!$data = $cache->load(get_class($resource) . '::getOne::' . $id )) { return; } return $data; } ); } </code> param: string $identifier Identifier for event emitting component. param: string $event param: callable $listener Listener that will handle the event. param: int $priority Priority at which listener should execute return: void |
detach(callable $listener, $identifier = null, $eventName = null, $force = false) X-Ref |
getListeners(array $identifiers, $eventName) X-Ref |
Retrieve all listeners for a given identifier and event param: string[] $identifiers param: string $eventName return: array[] |
clearListeners($identifier, $eventName = null) X-Ref |
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |