1 | <?php |
||
10 | class Database |
||
11 | { |
||
12 | /** |
||
13 | * The storage engine. |
||
14 | * |
||
15 | * @var EngineInterface |
||
16 | */ |
||
17 | protected $engine; |
||
18 | |||
19 | /** |
||
20 | * @var Parser |
||
21 | */ |
||
22 | protected $parser; |
||
23 | |||
24 | /** |
||
25 | * An array of the registered collections. |
||
26 | * |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $collections; |
||
30 | |||
31 | 1 | public function __construct(EngineInterface $engine) |
|
36 | |||
37 | /** |
||
38 | * Select an existing collection or create a new one. |
||
39 | * |
||
40 | * @param string $name |
||
41 | * |
||
42 | * @return Collection |
||
43 | */ |
||
44 | 1 | public function collection($name) |
|
48 | |||
49 | 1 | public function getOrCreateCollection($name) |
|
57 | |||
58 | 1 | public function createCollection($name) |
|
65 | |||
66 | public function dropCollection($name) |
||
73 | |||
74 | 1 | public function getParser() |
|
78 | |||
79 | 1 | protected function initializeParser() |
|
84 | |||
85 | 1 | protected function newCollection(DocumentStore $store, $name) |
|
89 | } |
||
90 |