Manager.php
2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
namespace Phalcon\Events {
/**
* Phalcon\Events\Manager
*
* Phalcon Events Manager, offers an easy way to intercept and manipulate, if needed,
* the normal flow of operation. With the EventsManager the developer can create hooks or
* plugins that will offer monitoring of data, manipulation, conditional execution and much more.
*
*/
class Manager implements \Phalcon\Events\ManagerInterface {
protected $_events;
protected $_collect;
protected $_enablePriorities;
protected $_responses;
/**
* Attach a listener to the events manager
*
* @param string $eventType
* @param object|callable $handler
* @param int $priority
*/
public function attach($eventType, $handler, $priority=null){ }
/**
* Set if priorities are enabled in the EventsManager
*
* @param boolean $enablePriorities
*/
public function enablePriorities($enablePriorities){ }
/**
* Returns if priorities are enabled
*
* @return boolean
*/
public function arePrioritiesEnabled(){ }
/**
* Tells the event manager if it needs to collect all the responses returned by every
* registered listener in a single fire
*
* @param boolean $collect
*/
public function collectResponses($collect){ }
/**
* Check if the events manager is collecting all all the responses returned by every
* registered listener in a single fire
*/
public function isCollecting(){ }
/**
* Returns all the responses returned by every handler executed by the last 'fire' executed
*
* @return array
*/
public function getResponses(){ }
/**
* Removes all events from the EventsManager
*
* @param string $type
*/
public function detachAll($type=null){ }
/**
* Removes all events from the EventsManager; alias of detachAll
*
* @deprecated
* @param string $type
*/
public function dettachAll($type=null){ }
/**
* Internal handler to call a queue of events
*
* @param \SplPriorityQueue $queue
* @param \Phalcon\Events\Event $event
* @return mixed
*/
public function fireQueue($queue, $event){ }
/**
* Fires an event in the events manager causing that active listeners be notified about it
*
*<code>
* $eventsManager->fire('db', $connection);
*</code>
*
* @param string $eventType
* @param object $source
* @param mixed $data
* @param int $cancelable
* @return mixed
*/
public function fire($eventType, $source, $data=null, $cancelable=null){ }
/**
* Check whether certain type of event has listeners
*
* @param string $type
* @return boolean
*/
public function hasListeners($type){ }
/**
* Returns all the attached listeners of a certain type
*
* @param string $type
* @return array
*/
public function getListeners($type){ }
}
}