1 | <?php |
||
43 | class EventManager extends ObjectAbstract implements EventManagerInterface |
||
44 | { |
||
45 | /** |
||
46 | * Events managing |
||
47 | * |
||
48 | * @var EventQueueInterface[] |
||
49 | * @access protected |
||
50 | */ |
||
51 | protected $events = []; |
||
52 | |||
53 | /** |
||
54 | * {@inheritDoc} |
||
55 | */ |
||
56 | public function attach($event, $callback, $priority = 0) |
||
64 | |||
65 | /** |
||
66 | * if call is NULL, clear this event. |
||
67 | * if event is '', clear all events |
||
68 | * |
||
69 | * {@inheritDoc} |
||
70 | */ |
||
71 | public function detach($event, $callback) |
||
80 | |||
81 | /** |
||
82 | * {@inheritDoc} |
||
83 | */ |
||
84 | public function clearListeners($event) |
||
88 | |||
89 | /** |
||
90 | * {@inheritDoc} |
||
91 | */ |
||
92 | public function trigger($event, $target = null, $argv = array()) |
||
114 | |||
115 | /** |
||
116 | * Has $eventName been bound ? |
||
117 | * |
||
118 | * @param string $eventName |
||
119 | * @return bool |
||
120 | * @access protected |
||
121 | */ |
||
122 | protected function hasEvent(/*# string */ $eventName)/*# : bool */ |
||
126 | |||
127 | /** |
||
128 | * Create a new event |
||
129 | * |
||
130 | * @param string|EventInterface $eventName |
||
131 | * @param object|string|null $target |
||
132 | * @param array $parameters |
||
133 | * @return EventInterface |
||
134 | * @access protected |
||
135 | */ |
||
136 | protected function newEvent( |
||
147 | |||
148 | /** |
||
149 | * Get a new event queue |
||
150 | * |
||
151 | * @return EventQueueInterface |
||
152 | * @access protected |
||
153 | */ |
||
154 | protected function newEventQueue()/*# : EventQueueInterface */ |
||
158 | |||
159 | /** |
||
160 | * Get related event handler queue for this $eventName |
||
161 | * |
||
162 | * @param string $eventName |
||
163 | * @return EventQueueInterface |
||
164 | * @access protected |
||
165 | */ |
||
166 | protected function getMatchedQueue( |
||
175 | |||
176 | /** |
||
177 | * Remove event or its callable |
||
178 | * |
||
179 | * @param string $eventName |
||
180 | * @param callable|null $callable |
||
181 | * @access protected |
||
182 | */ |
||
183 | protected function removeEventCallable( |
||
200 | } |
||
201 |