1 | <?php |
||
16 | class DocumentManager |
||
17 | { |
||
18 | /** |
||
19 | * @var Client |
||
20 | */ |
||
21 | private $client; |
||
22 | |||
23 | /** |
||
24 | * @var Database |
||
25 | */ |
||
26 | private $database; |
||
27 | |||
28 | /** |
||
29 | * @var Repository[] |
||
30 | */ |
||
31 | private $repositories = []; |
||
32 | |||
33 | /** |
||
34 | * @var LoggerInterface |
||
35 | */ |
||
36 | private $logger; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | private $configuration = []; |
||
42 | |||
43 | /** |
||
44 | * @param array $configuration |
||
45 | * @throws \Exception |
||
46 | */ |
||
47 | 14 | public function __construct(array $configuration = array(), LoggerInterface $logger = null) |
|
96 | |||
97 | /** |
||
98 | * @param $name |
||
99 | * @return Repository |
||
100 | */ |
||
101 | 14 | public function getRepository($name) |
|
121 | |||
122 | /** |
||
123 | * @param $collection |
||
124 | * @param $id |
||
125 | * @param array $options |
||
126 | * @return null|object |
||
127 | */ |
||
128 | 1 | public function find($collection, $id, array $options = []) |
|
132 | |||
133 | /** |
||
134 | * @param $collectionName |
||
135 | * @param array $filter |
||
136 | * @return \MongoDB\DeleteResult |
||
137 | */ |
||
138 | 14 | public function removeAll($collectionName, array $filter = []) |
|
147 | |||
148 | /** |
||
149 | * |
||
150 | */ |
||
151 | public function createIndexes() |
||
156 | |||
157 | /** |
||
158 | * @param $configuration |
||
159 | * @throws \Exception |
||
160 | */ |
||
161 | 14 | private function validateConfiguration($configuration) |
|
179 | |||
180 | /** |
||
181 | * Build all indexes |
||
182 | * |
||
183 | * @param null $callback |
||
184 | */ |
||
185 | public function buildIndexes($rebuild = false, $callback = null) |
||
191 | |||
192 | /** |
||
193 | * @return Database |
||
194 | */ |
||
195 | 14 | public function getDatabase() { |
|
199 | |||
200 | /** |
||
201 | * @return LoggerInterface|NullLogger |
||
202 | */ |
||
203 | 14 | public function getLogger() { |
|
207 | |||
208 | } |
||
209 |