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