Added the zend framework 2 library, the path is specified in line no.26 in zend_modul...
[openemr.git] / interface / modules / zend_modules / library / Zend / EventManager / ListenerAggregateTrait.php
blobfabedc03cd8f8abe3a7e3256a265b72e3aa84544
1 <?php
2 /**
3 * Zend Framework (http://framework.zend.com/)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository
6 * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
7 * @license http://framework.zend.com/license/new-bsd New BSD License
8 */
10 namespace Zend\EventManager;
12 /**
13 * Provides logic to easily create aggregate listeners, without worrying about
14 * manually detaching events
16 trait ListenerAggregateTrait
18 /**
19 * @var \Zend\Stdlib\CallbackHandler[]
21 protected $listeners = array();
23 /**
24 * {@inheritDoc}
26 public function detach(EventManagerInterface $events)
28 foreach ($this->listeners as $index => $callback) {
29 if ($events->detach($callback)) {
30 unset($this->listeners[$index]);