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