1: <?php
2: /**
3: *
4: *
5: * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
6: * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
7: *
8: * Licensed under The MIT License
9: * For full copyright and license information, please see the LICENSE.txt
10: * Redistributions of files must retain the above copyright notice.
11: *
12: * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
13: * @link http://cakephp.org CakePHP(tm) Project
14: * @package Cake.Observer
15: * @since CakePHP(tm) v 2.1
16: * @license http://www.opensource.org/licenses/mit-license.php MIT License
17: */
18:
19: /**
20: * Objects implementing this interface should declare the `implementedEvents` function
21: * to notify the event manager what methods should be called when an event is triggered.
22: *
23: * @package Cake.Event
24: */
25: interface CakeEventListener {
26:
27: /**
28: * Returns a list of events this object is implementing. When the class is registered
29: * in an event manager, each individual method will be associated with the respective event.
30: *
31: * ## Example:
32: *
33: * {{{
34: * public function implementedEvents() {
35: * return array(
36: * 'Order.complete' => 'sendEmail',
37: * 'Article.afterBuy' => 'decrementInventory',
38: * 'User.onRegister' => array('callable' => 'logRegistration', 'priority' => 20, 'passParams' => true)
39: * );
40: * }
41: * }}}
42: *
43: * @return array associative array or event key names pointing to the function
44: * that should be called in the object when the respective event is fired
45: */
46: public function implementedEvents();
47:
48: }
49: