File indexing completed on 2024-05-12 06:02:28

0001 <?php
0002 /**
0003  * Zend Framework
0004  *
0005  * LICENSE
0006  *
0007  * This source file is subject to the new BSD license that is bundled
0008  * with this package in the file LICENSE.txt.
0009  * It is also available through the world-wide-web at this URL:
0010  * http://framework.zend.com/license/new-bsd
0011  * If you did not receive a copy of the license and are unable to
0012  * obtain it through the world-wide-web, please send an email
0013  * to license@zend.com so we can send you a copy immediately.
0014  *
0015  * @category   Zend
0016  * @package    Zend_EventManager
0017  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0018  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0019  */
0020 
0021 /**
0022  * Interface for self-registering event listeners.
0023  *
0024  * Classes implementing this interface may be registered by name or instance
0025  * with an EventManager, without an event name. The {@link attach()} method will
0026  * then be called with the current EventManager instance, allowing the class to
0027  * wire up one or more listeners.
0028  *
0029  * @category   Zend
0030  * @package    Zend_EventManager
0031  * @copyright  Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
0032  * @license    http://framework.zend.com/license/new-bsd     New BSD License
0033  */
0034 interface Zend_EventManager_ListenerAggregate
0035 {
0036     /**
0037      * Attach one or more listeners
0038      *
0039      * Implementors may add an optional $priority argument; the EventManager
0040      * implementation will pass this to the aggregate.
0041      *
0042      * @param Zend_EventManager_EventCollection $events
0043      * @param null|int $priority Optional priority "hint" to use when attaching listeners
0044      */
0045     public function attach(Zend_EventManager_EventCollection $events);
0046 
0047     /**
0048      * Detach all previously attached listeners
0049      *
0050      * @param Zend_EventManager_EventCollection $events
0051      */
0052     public function detach(Zend_EventManager_EventCollection $events);
0053 }