1 | <?php |
||
30 | class MongoStorage implements StorageInterface |
||
31 | { |
||
32 | use TransactionalTrait { |
||
33 | TransactionalTrait::beginTransaction as protected parentBeginTransaction; |
||
34 | TransactionalTrait::commit as protected parentCommit; |
||
35 | TransactionalTrait::rollback as protected parentRollback; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @var Manager |
||
40 | */ |
||
41 | private $conn; |
||
42 | |||
43 | /** |
||
44 | * @var string |
||
45 | */ |
||
46 | private $db; |
||
47 | |||
48 | /** |
||
49 | * @var SnapshotInterface |
||
50 | */ |
||
51 | private $snapshot; |
||
52 | |||
53 | /** |
||
54 | * Constructor. |
||
55 | * |
||
56 | * @param MongoConfig $config |
||
57 | * @param SnapshotInterface $snapshot |
||
58 | */ |
||
59 | public function __construct(MongoConfig $config, SnapshotInterface $snapshot = null) |
||
65 | |||
66 | /** |
||
67 | * @param SnapshotInterface $snapshot |
||
68 | */ |
||
69 | public function attachSnapshot(SnapshotInterface $snapshot) |
||
73 | |||
74 | /** |
||
75 | * @return SnapshotInterface |
||
76 | */ |
||
77 | public function getSnapshot() |
||
81 | |||
82 | /** |
||
83 | * {@inheritdoc} |
||
84 | */ |
||
85 | public function findEventFromBeginning($table, IdentifierInterface $id) |
||
97 | |||
98 | /** |
||
99 | * {@inheritdoc} |
||
100 | */ |
||
101 | public function findEventFromVersion($table, IdentifierInterface $id, $version) |
||
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | */ |
||
114 | public function append($table, DomainMessageInterface $message, $status, array $exception = null) |
||
130 | |||
131 | /** |
||
132 | * {@inheritdoc} |
||
133 | */ |
||
134 | public function drop($table) |
||
140 | |||
141 | /** |
||
142 | * {@inheritdoc} |
||
143 | */ |
||
144 | public function beginTransaction() |
||
152 | |||
153 | /** |
||
154 | * {@inheritdoc} |
||
155 | */ |
||
156 | public function rollback() |
||
164 | |||
165 | /** |
||
166 | * {@inheritdoc} |
||
167 | */ |
||
168 | public function commit() |
||
176 | |||
177 | /** |
||
178 | * {@inheritdoc} |
||
179 | */ |
||
180 | protected function performCommit($table, array $records) |
||
184 | |||
185 | /** |
||
186 | * {@inheritdoc} |
||
187 | */ |
||
188 | protected function performRollback($table, array $records) |
||
200 | |||
201 | /** |
||
202 | * Serialize domain message. |
||
203 | * |
||
204 | * @param DomainMessageInterface $domain |
||
205 | * |
||
206 | * @return array |
||
207 | */ |
||
208 | private function serialize(DomainMessageInterface $domain) |
||
220 | |||
221 | /** |
||
222 | * Deserialize data to domain message. |
||
223 | * |
||
224 | * @param array $record |
||
225 | * |
||
226 | * @return DomainMessage |
||
227 | */ |
||
228 | private function deserialize(array $record) |
||
237 | |||
238 | /** |
||
239 | * Build an object from serialized data |
||
240 | * |
||
241 | * @param array $serializedObject |
||
242 | * |
||
243 | * @return DomainEventInterface |
||
244 | */ |
||
245 | private function build(array $serializedObject) |
||
265 | |||
266 | /** |
||
267 | * Assert array key |
||
268 | * |
||
269 | * @param array $serializeObject |
||
270 | * @param string $key |
||
271 | */ |
||
272 | private function assertKeyExists(array $serializeObject, $key) |
||
278 | |||
279 | /** |
||
280 | * Get namespace. |
||
281 | * |
||
282 | * @param string $table |
||
283 | * |
||
284 | * @return string |
||
285 | */ |
||
286 | private function getNamespace($table) |
||
290 | |||
291 | /** |
||
292 | * Execute mongodb query. |
||
293 | * |
||
294 | * @param Query $query |
||
295 | * @param string $namespace |
||
296 | * |
||
297 | * @return DomainEventStream|null |
||
298 | */ |
||
299 | private function query(Query $query, $namespace) |
||
316 | } |
||
317 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.