1 | <?php |
||
12 | class Yaysondb implements TransactableInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var Collection[] Loaded collections |
||
16 | */ |
||
17 | private $collections; |
||
18 | |||
19 | /** |
||
20 | * Optionally load collection engines |
||
21 | * |
||
22 | * @param EngineInterface[] $engines Maps identifiers to engines |
||
23 | */ |
||
24 | public function __construct(array $engines = []) |
||
33 | |||
34 | /** |
||
35 | * Load collection engine |
||
36 | */ |
||
37 | public function load(EngineInterface $engine, string $engineId = ''): self |
||
42 | |||
43 | /** |
||
44 | * Check if handle contains collection with id |
||
45 | */ |
||
46 | public function hasCollection(string $id): bool |
||
50 | |||
51 | /** |
||
52 | * Magic method to allow collection exploration through property names |
||
53 | */ |
||
54 | public function __isset(string $id): bool |
||
58 | |||
59 | /** |
||
60 | * Get collection |
||
61 | * |
||
62 | * @throws Exception\LogicException If id is not defined |
||
63 | */ |
||
64 | public function collection(string $id): CollectionInterface |
||
72 | |||
73 | /** |
||
74 | * Magic method to allow collection access through property names |
||
75 | */ |
||
76 | public function __get(string $id): CollectionInterface |
||
80 | |||
81 | public function commit() |
||
89 | |||
90 | public function inTransaction(): bool |
||
100 | |||
101 | public function reset() |
||
109 | } |
||
110 |