1 | <?php |
||
13 | final class TransactionalEmitter implements EmitterInterface, Transactional |
||
14 | { |
||
15 | /** @var EmitterInterface */ |
||
16 | private $emitter; |
||
17 | |||
18 | /** @var array */ |
||
19 | private $events = []; |
||
20 | |||
21 | /** @var bool */ |
||
22 | private $running; |
||
23 | |||
24 | /** |
||
25 | * Constructor. |
||
26 | * |
||
27 | * @param EmitterInterface $emitter |
||
28 | */ |
||
29 | 45 | public function __construct(EmitterInterface $emitter) |
|
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | 21 | public function emit($event) |
|
47 | |||
48 | /** |
||
49 | * {@inheritdoc} |
||
50 | */ |
||
51 | 6 | public function emitBatch(array $events) |
|
61 | |||
62 | /** |
||
63 | * {@inheritdoc} |
||
64 | */ |
||
65 | 3 | public function emitGeneratedEvents(GeneratorInterface $generator) |
|
71 | |||
72 | /** |
||
73 | * @param $event |
||
74 | * |
||
75 | * @return EventInterface |
||
76 | */ |
||
77 | 18 | private function addEvent($event) |
|
93 | |||
94 | /** |
||
95 | * {@inheritdoc} |
||
96 | */ |
||
97 | 18 | public function beginTransaction() |
|
101 | |||
102 | /** |
||
103 | * {@inheritdoc} |
||
104 | */ |
||
105 | 12 | public function commit() |
|
114 | |||
115 | /** |
||
116 | * {@inheritdoc} |
||
117 | */ |
||
118 | 3 | public function rollback() |
|
123 | |||
124 | /** |
||
125 | * {@inheritdoc} |
||
126 | */ |
||
127 | 3 | public function removeListener($event, $listener) |
|
133 | |||
134 | /** |
||
135 | * {@inheritdoc} |
||
136 | */ |
||
137 | 3 | public function useListenerProvider(ListenerProviderInterface $provider) |
|
143 | |||
144 | /** |
||
145 | * {@inheritdoc} |
||
146 | */ |
||
147 | 3 | public function removeAllListeners($event) |
|
153 | |||
154 | /** |
||
155 | * {@inheritdoc} |
||
156 | */ |
||
157 | 3 | public function hasListeners($event) |
|
161 | |||
162 | /** |
||
163 | * {@inheritdoc} |
||
164 | */ |
||
165 | 3 | public function getListeners($event) |
|
169 | |||
170 | /** |
||
171 | * {@inheritdoc} |
||
172 | */ |
||
173 | 3 | public function addListener($event, $listener, $priority = self::P_NORMAL) |
|
179 | |||
180 | /** |
||
181 | * {@inheritdoc} |
||
182 | */ |
||
183 | 3 | public function addOneTimeListener($event, $listener, $priority = self::P_NORMAL) |
|
189 | } |
||
190 |