1 | <?php |
||
27 | class FormObjectConfiguration |
||
28 | { |
||
29 | /** |
||
30 | * @var FormObjectStatic |
||
31 | */ |
||
32 | protected $formObject; |
||
33 | |||
34 | /** |
||
35 | * Contains the form configuration. |
||
36 | * |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $configurationArray = []; |
||
40 | |||
41 | /** |
||
42 | * Contains the form configuration object, which was created from the |
||
43 | * configuration array. |
||
44 | * |
||
45 | * @var ConfigurationObjectInstance |
||
46 | */ |
||
47 | protected $configurationObject; |
||
48 | |||
49 | /** |
||
50 | * @var Result |
||
51 | */ |
||
52 | protected $configurationValidationResult; |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | */ |
||
57 | protected $lastConfigurationHash; |
||
58 | |||
59 | /** |
||
60 | * @var ConfigurationFactory |
||
61 | */ |
||
62 | protected $configurationFactory; |
||
63 | |||
64 | /** |
||
65 | * @param FormObjectStatic $formObject |
||
66 | * @param array $configurationArray |
||
67 | */ |
||
68 | public function __construct(FormObjectStatic $formObject, array $configurationArray) |
||
73 | |||
74 | /** |
||
75 | * Returns an instance of configuration object. Checks if it was previously |
||
76 | * stored in cache, otherwise it is created from scratch. |
||
77 | * |
||
78 | * @return ConfigurationObjectInstance |
||
79 | */ |
||
80 | public function getConfigurationObject() |
||
91 | |||
92 | /** |
||
93 | * This function will merge and return the validation results of both the |
||
94 | * global FormZ configuration object, and this form configuration object. |
||
95 | * |
||
96 | * @return Result |
||
97 | */ |
||
98 | public function getConfigurationValidationResult() |
||
109 | |||
110 | /** |
||
111 | * Resets the validation result and merges it with the global FormZ |
||
112 | * configuration. |
||
113 | * |
||
114 | * @param ConfigurationObjectInstance $configurationObject |
||
115 | * @return Result |
||
116 | */ |
||
117 | protected function refreshConfigurationValidationResult(ConfigurationObjectInstance $configurationObject) |
||
131 | |||
132 | /** |
||
133 | * @param ConfigurationObjectInstance $configurationObject |
||
134 | * @return Result |
||
135 | */ |
||
136 | protected function validateFormConfiguration(ConfigurationObjectInstance $configurationObject) |
||
148 | |||
149 | /** |
||
150 | * @return ConfigurationObjectInstance |
||
151 | */ |
||
152 | protected function getConfigurationObjectFromCache() |
||
169 | |||
170 | /** |
||
171 | * @return ConfigurationObjectInstance |
||
172 | */ |
||
173 | protected function buildConfigurationObject() |
||
177 | |||
178 | /** |
||
179 | * This function will clean the configuration array by removing useless data |
||
180 | * and updating needed ones. |
||
181 | * |
||
182 | * @param array $configuration |
||
183 | * @return array |
||
184 | */ |
||
185 | protected function sanitizeConfiguration(array $configuration) |
||
203 | |||
204 | /** |
||
205 | * @param array $configuration |
||
206 | * @return ConfigurationObjectInstance |
||
207 | */ |
||
208 | protected function getConfigurationObjectInstance(array $configuration) |
||
212 | |||
213 | /** |
||
214 | * @return FrontendInterface |
||
215 | */ |
||
216 | protected function getCacheInstance() |
||
220 | |||
221 | /** |
||
222 | * @param ConfigurationFactory $configurationFactory |
||
223 | */ |
||
224 | public function injectConfigurationFactory(ConfigurationFactory $configurationFactory) |
||
228 | |||
229 | public function __sleep() |
||
233 | |||
234 | /** |
||
235 | * When this class is unserialized, the dependencies are injected. |
||
236 | */ |
||
237 | public function __wakeup() |
||
244 | } |
||
245 |