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