1 | <?php |
||
21 | class DocumentInstantiator implements InstantiatorInterface |
||
22 | { |
||
23 | /** |
||
24 | * @invisible |
||
25 | * @var ODMInterface |
||
26 | */ |
||
27 | private $odm; |
||
28 | |||
29 | /** |
||
30 | * Primary instantiation class. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | private $class = ''; |
||
35 | |||
36 | /** |
||
37 | * Normalized schema delivered by DocumentSchema. |
||
38 | * |
||
39 | * @var array |
||
40 | */ |
||
41 | private $schema = []; |
||
42 | |||
43 | /** |
||
44 | * @param ODMInterface $odm |
||
45 | * @param string $class |
||
46 | * @param array $schema |
||
47 | */ |
||
48 | public function __construct(ODMInterface $odm, string $class, array $schema) |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | * |
||
58 | * @return CompositableInterface|DocumentEntity|Document |
||
59 | * |
||
60 | * @throws InstantionException |
||
61 | */ |
||
62 | public function make($fields, bool $filter = true): CompositableInterface |
||
96 | |||
97 | /** |
||
98 | * Define document class using it's fieldset and definition. |
||
99 | * |
||
100 | * @param \ArrayAccess|array $fields |
||
101 | * |
||
102 | * @return string |
||
103 | * |
||
104 | * @throws DefinitionException |
||
105 | */ |
||
106 | protected function defineClass($fields) |
||
132 | } |