1 | <?php |
||
14 | class ODM extends Component implements ODMInterface, SingletonInterface |
||
15 | { |
||
16 | /** |
||
17 | * Memory section to store ODM schema. |
||
18 | */ |
||
19 | const MEMORY = 'odm.schema'; |
||
20 | |||
21 | /** |
||
22 | * Already created instantiators. |
||
23 | * |
||
24 | * @invisible |
||
25 | * @var InstantiatorInterface[] |
||
26 | */ |
||
27 | private $instantiators = []; |
||
28 | |||
29 | /** |
||
30 | * Set of classes responsible for document save operations. |
||
31 | * |
||
32 | * @invisible |
||
33 | * |
||
34 | * @var MapperInterface[] |
||
35 | */ |
||
36 | private $mappers = []; |
||
37 | |||
38 | /** |
||
39 | * ODM schema. |
||
40 | * |
||
41 | * @invisible |
||
42 | * @var array |
||
43 | */ |
||
44 | private $schema = []; |
||
45 | |||
46 | /** |
||
47 | * @var MongoManager |
||
48 | */ |
||
49 | protected $manager; |
||
50 | |||
51 | /** |
||
52 | * @invisible |
||
53 | * @var MemoryInterface |
||
54 | */ |
||
55 | protected $memory; |
||
56 | |||
57 | /** |
||
58 | * @var FactoryInterface |
||
59 | */ |
||
60 | protected $factory; |
||
61 | |||
62 | /** |
||
63 | * @param MongoManager $manager |
||
64 | * @param MemoryInterface $memory |
||
65 | * @param FactoryInterface $factory |
||
66 | */ |
||
67 | public function __construct( |
||
79 | |||
80 | public function setSchema($s) |
||
84 | |||
85 | protected function loadSchema() |
||
88 | |||
89 | protected function updateSchema() |
||
93 | |||
94 | /** |
||
95 | * Instantiate document/model instance based on a given class name and fieldset. Some ODM |
||
96 | * documents might return instances of their child if fields point to child model schema. |
||
97 | * |
||
98 | * @param string $class |
||
99 | * @param array $fields |
||
100 | * |
||
101 | * @return CompositableInterface |
||
102 | */ |
||
103 | public function instantiate(string $class, $fields = []): CompositableInterface |
||
107 | |||
108 | public function selector(string $class) |
||
113 | |||
114 | public function mapper(string $class) |
||
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | public function instantiator(string $class): InstantiatorInterface |
||
138 | |||
139 | /** |
||
140 | * Get property from cached schema. |
||
141 | * |
||
142 | * @param string $class |
||
143 | * @param int $property See ODM constants. |
||
144 | * |
||
145 | * @return mixed |
||
146 | */ |
||
147 | protected function schema(string $class, int $property) |
||
151 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.