1 | <?php |
||
15 | class DocumentFactory |
||
16 | { |
||
17 | /** |
||
18 | * @param array $postValues |
||
19 | * @param DocumentTypesStorage $documentTypesStorage |
||
20 | * |
||
21 | * @return \library\storage\Document |
||
22 | */ |
||
23 | public static function createDocumentFromPostValues($postValues, DocumentTypesStorage $documentTypesStorage) |
||
40 | |||
41 | /** |
||
42 | * @param array $postValues |
||
43 | * @param \stdClass $documentType |
||
44 | * |
||
45 | * @return Document |
||
46 | */ |
||
47 | private static function createInitialDocumentObject($postValues, $documentType) |
||
62 | |||
63 | /** |
||
64 | * @param array $postValues |
||
65 | * @param Document $documentObj |
||
66 | * @param array $staticBricks |
||
67 | * |
||
68 | * @return Document |
||
69 | */ |
||
70 | private static function createBrickArrayForDocument($postValues, $documentObj, $staticBricks) |
||
86 | |||
87 | /** |
||
88 | * @param array $postValues |
||
89 | * @param Document $documentObj |
||
90 | * |
||
91 | * @return Document |
||
92 | */ |
||
93 | private static function createDynamicBrickArrayForDocument($postValues, $documentObj) |
||
110 | |||
111 | /** |
||
112 | * @param $staticBricks |
||
113 | * @param $brickSlug |
||
114 | * |
||
115 | * @return array |
||
116 | */ |
||
117 | private static function getStaticBrickAndSetMultiple($staticBricks, $brickSlug) |
||
130 | |||
131 | /** |
||
132 | * @param $staticBrick |
||
133 | * @param $brickInstance |
||
134 | * |
||
135 | * @return \stdClass |
||
136 | */ |
||
137 | private static function createBrick($staticBrick, $brickInstance) |
||
149 | |||
150 | /** |
||
151 | * @param $documentObj |
||
152 | * @param $brick |
||
153 | * @param $staticBrick |
||
154 | * @param $brickSlug |
||
155 | * |
||
156 | * @return mixed |
||
157 | */ |
||
158 | private static function addMultipleBricks($documentObj, $brick, $staticBrick, $brickSlug) |
||
172 | |||
173 | /** |
||
174 | * @param $documentObj |
||
175 | * @param $brick |
||
176 | * @param $brickSlug |
||
177 | * |
||
178 | * @return mixed |
||
179 | */ |
||
180 | private static function addSingleBrick($documentObj, $brick, $brickSlug) |
||
187 | } |