1 | <?php |
||
34 | class EventManager extends ObjectAbstract implements EventManagerInterface |
||
35 | { |
||
36 | /** |
||
37 | * Events managing |
||
38 | * |
||
39 | * @var EventQueueInterface[] |
||
40 | * @access protected |
||
41 | */ |
||
42 | protected $events = []; |
||
43 | |||
44 | /** |
||
45 | * {@inheritDoc} |
||
46 | */ |
||
47 | public function on( |
||
59 | |||
60 | /** |
||
61 | * {@inheritDoc} |
||
62 | */ |
||
63 | public function off( |
||
77 | |||
78 | /** |
||
79 | * {@inheritDoc} |
||
80 | */ |
||
81 | public function trigger($event, $context = null, array $properties = []) |
||
102 | |||
103 | /** |
||
104 | * Has $eventName been defined ? |
||
105 | * |
||
106 | * @param string $eventName |
||
107 | * @return bool |
||
108 | * @access protected |
||
109 | */ |
||
110 | protected function hasEventQueue(/*# string */ $eventName)/*# : bool */ |
||
114 | |||
115 | /** |
||
116 | * Create a new event |
||
117 | * |
||
118 | * @param string|EventInterface $eventName |
||
119 | * @param object|string|null $context |
||
120 | * @param array $properties |
||
121 | * @return EventInterface |
||
122 | * @access protected |
||
123 | */ |
||
124 | protected function newEvent( |
||
135 | |||
136 | /** |
||
137 | * Get a new event queue |
||
138 | * |
||
139 | * @return EventQueueInterface |
||
140 | * @access protected |
||
141 | */ |
||
142 | protected function newEventQueue()/*# : EventQueueInterface */ |
||
146 | |||
147 | /** |
||
148 | * Get related event handler queue for this $eventName |
||
149 | * |
||
150 | * @param string $eventName |
||
151 | * @return EventQueueInterface |
||
152 | * @access protected |
||
153 | */ |
||
154 | protected function getMatchedQueue( |
||
163 | |||
164 | /** |
||
165 | * Remove event or its callable |
||
166 | * |
||
167 | * @param string $eventName |
||
168 | * @param callable|null $callable |
||
169 | * @access protected |
||
170 | */ |
||
171 | protected function removeEvent( |
||
188 | } |
||
189 |