1 | <?php |
||
26 | class FormObjectConfiguration |
||
27 | { |
||
28 | /** |
||
29 | * @var FormObjectStatic |
||
30 | */ |
||
31 | protected $static; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $configurationArray = []; |
||
37 | |||
38 | /** |
||
39 | * Contains the form configuration object, which was created from the |
||
40 | * configuration array. |
||
41 | * |
||
42 | * @var ConfigurationObjectInstance |
||
43 | */ |
||
44 | protected $configurationObject; |
||
45 | |||
46 | /** |
||
47 | * @var Result |
||
48 | */ |
||
49 | protected $configurationValidationResult; |
||
50 | |||
51 | /** |
||
52 | * Flag to know if the form configuration is valid or not: if the |
||
53 | * configuration is fetched from cache, then we know the configuration is |
||
54 | * valid because it saved in cache only when no error is found. |
||
55 | * |
||
56 | * @var bool |
||
57 | */ |
||
58 | protected $configurationIsValid = false; |
||
59 | |||
60 | /** |
||
61 | * @param FormObjectStatic $static |
||
62 | * @param array $configurationArray |
||
63 | */ |
||
64 | public function __construct(FormObjectStatic $static, array $configurationArray) |
||
69 | |||
70 | /** |
||
71 | * Returns an instance of configuration object. Checks if it was previously |
||
72 | * stored in cache, otherwise it is created from scratch. |
||
73 | * |
||
74 | * @return ConfigurationObjectInstance |
||
75 | */ |
||
76 | public function getConfigurationObject() |
||
84 | |||
85 | /** |
||
86 | * This function will merge and return the validation results of both the |
||
87 | * global FormZ configuration object, and this form configuration object. |
||
88 | * |
||
89 | * @return Result |
||
90 | */ |
||
91 | public function getConfigurationValidationResult() |
||
99 | |||
100 | /** |
||
101 | * Resets the validation result and merges it with the global FormZ |
||
102 | * configuration. |
||
103 | * |
||
104 | * @return Result |
||
105 | */ |
||
106 | protected function getGlobalConfigurationValidationResult() |
||
124 | |||
125 | /** |
||
126 | * @param ConfigurationObjectInstance $configurationObject |
||
127 | * @return Result |
||
128 | */ |
||
129 | protected function getFormConfigurationValidationResult(ConfigurationObjectInstance $configurationObject) |
||
142 | |||
143 | /** |
||
144 | * @return ConfigurationObjectInstance |
||
145 | */ |
||
146 | protected function getConfigurationObjectFromCache() |
||
165 | |||
166 | /** |
||
167 | * This function will clean the configuration array by removing useless data |
||
168 | * and updating needed ones. |
||
169 | * |
||
170 | * @param array $configuration |
||
171 | * @return array |
||
172 | */ |
||
173 | protected function sanitizeConfiguration(array $configuration) |
||
191 | |||
192 | /** |
||
193 | * @param array $configuration |
||
194 | * @return ConfigurationObjectInstance |
||
195 | */ |
||
196 | protected function getConfigurationObjectInstance(array $configuration) |
||
200 | |||
201 | /** |
||
202 | * @return FrontendInterface |
||
203 | */ |
||
204 | protected function getCacheInstance() |
||
208 | |||
209 | /** |
||
210 | * @return array |
||
211 | */ |
||
212 | public function __sleep() |
||
216 | } |
||
217 |