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 | * @var array |
||
55 | */ |
||
56 | private $watched = array(); |
||
|
|||
57 | |||
58 | /** |
||
59 | * @var bool |
||
60 | */ |
||
61 | private $transactional = false; |
||
62 | |||
63 | /** |
||
64 | * @var int |
||
65 | */ |
||
66 | private $transactionalLevel = 0; |
||
67 | |||
68 | /** |
||
69 | * Constructor. |
||
70 | * |
||
71 | * @param MongoConfig $config |
||
72 | * @param SnapshotInterface $snapshot |
||
73 | */ |
||
74 | public function __construct(MongoConfig $config, SnapshotInterface $snapshot = null) |
||
80 | |||
81 | /** |
||
82 | * @param SnapshotInterface $snapshot |
||
83 | */ |
||
84 | public function attachSnapshot(SnapshotInterface $snapshot) |
||
88 | |||
89 | /** |
||
90 | * @return SnapshotInterface |
||
91 | */ |
||
92 | public function getSnapshot() |
||
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | public function findEventFromBeginning($table, IdentifierInterface $id) |
||
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | public function findEventFromVersion($table, IdentifierInterface $id, $version) |
||
125 | |||
126 | /** |
||
127 | * {@inheritdoc} |
||
128 | */ |
||
129 | public function append($table, DomainMessageInterface $message, $status, array $exception = null) |
||
145 | |||
146 | /** |
||
147 | * {@inheritdoc} |
||
148 | */ |
||
149 | public function drop($table) |
||
155 | |||
156 | /** |
||
157 | * {@inheritdoc} |
||
158 | */ |
||
159 | public function beginTransaction() |
||
167 | |||
168 | /** |
||
169 | * {@inheritdoc} |
||
170 | */ |
||
171 | public function rollback() |
||
179 | |||
180 | /** |
||
181 | * {@inheritdoc} |
||
182 | */ |
||
183 | public function commit() |
||
191 | |||
192 | /** |
||
193 | * {@inheritdoc} |
||
194 | */ |
||
195 | protected function performCommit($table, array $records) |
||
199 | |||
200 | /** |
||
201 | * {@inheritdoc} |
||
202 | */ |
||
203 | protected function performRollback($table, array $records) |
||
215 | |||
216 | /** |
||
217 | * Serialize domain message. |
||
218 | * |
||
219 | * @param DomainMessageInterface $domain |
||
220 | * |
||
221 | * @return array |
||
222 | */ |
||
223 | private function serialize(DomainMessageInterface $domain) |
||
235 | |||
236 | /** |
||
237 | * Deserialize data to domain message. |
||
238 | * |
||
239 | * @param array $record |
||
240 | * |
||
241 | * @return DomainMessage |
||
242 | */ |
||
243 | private function deserialize(array $record) |
||
252 | |||
253 | /** |
||
254 | * Build an object from serialized data |
||
255 | * |
||
256 | * @param array $serializedObject |
||
257 | * |
||
258 | * @return DomainEventInterface |
||
259 | */ |
||
260 | private function build(array $serializedObject) |
||
280 | |||
281 | /** |
||
282 | * Assert array key |
||
283 | * |
||
284 | * @param array $serializeObject |
||
285 | * @param string $key |
||
286 | */ |
||
287 | private function assertKeyExists(array $serializeObject, $key) |
||
293 | |||
294 | /** |
||
295 | * Get namespace. |
||
296 | * |
||
297 | * @param string $table |
||
298 | * |
||
299 | * @return string |
||
300 | */ |
||
301 | private function getNamespace($table) |
||
305 | |||
306 | /** |
||
307 | * Execute mongodb query. |
||
308 | * |
||
309 | * @param Query $query |
||
310 | * @param string $namespace |
||
311 | * |
||
312 | * @return DomainEventStream|null |
||
313 | */ |
||
314 | private function query(Query $query, $namespace) |
||
331 | } |
||
332 |
This check marks private properties in classes that are never used. Those properties can be removed.