1 | <?php |
||
35 | class EventManager extends ObjectAbstract implements EventManagerInterface |
||
36 | { |
||
37 | /** |
||
38 | * Events managing |
||
39 | * |
||
40 | * @var EventQueueInterface[] |
||
41 | * @access protected |
||
42 | */ |
||
43 | protected $events = []; |
||
44 | |||
45 | /** |
||
46 | * {@inheritDoc} |
||
47 | */ |
||
48 | public function attach($event, $callback, $priority = 0) |
||
56 | |||
57 | /** |
||
58 | * {@inheritDoc} |
||
59 | */ |
||
60 | public function detach($event, $callback) |
||
69 | |||
70 | /** |
||
71 | * {@inheritDoc} |
||
72 | */ |
||
73 | public function clearListeners($event) |
||
77 | |||
78 | /** |
||
79 | * {@inheritDoc} |
||
80 | */ |
||
81 | public function trigger($event, $target = null, $argv = array()) |
||
103 | |||
104 | /** |
||
105 | * Has $eventName been bound ? |
||
106 | * |
||
107 | * @param string $eventName |
||
108 | * @return bool |
||
109 | * @access protected |
||
110 | */ |
||
111 | protected function hasEvent(/*# string */ $eventName)/*# : bool */ |
||
115 | |||
116 | /** |
||
117 | * Create a new event |
||
118 | * |
||
119 | * @param string|EventInterface $eventName |
||
120 | * @param object|string|null $target |
||
121 | * @param array $parameters |
||
122 | * @return EventInterface |
||
123 | * @access protected |
||
124 | */ |
||
125 | protected function newEvent( |
||
136 | |||
137 | /** |
||
138 | * Get a new event queue |
||
139 | * |
||
140 | * @return EventQueueInterface |
||
141 | * @access protected |
||
142 | */ |
||
143 | protected function newEventQueue()/*# : EventQueueInterface */ |
||
147 | |||
148 | /** |
||
149 | * Get related event handler queue for this $eventName |
||
150 | * |
||
151 | * @param string $eventName |
||
152 | * @return EventQueueInterface |
||
153 | * @access protected |
||
154 | */ |
||
155 | protected function getMatchedQueue( |
||
164 | |||
165 | /** |
||
166 | * Remove event or its callable |
||
167 | * |
||
168 | * @param string $eventName |
||
169 | * @param callable|null $callable |
||
170 | * @access protected |
||
171 | */ |
||
172 | protected function removeEventCallable( |
||
189 | } |
||
190 |