1 | <?php |
||
26 | class FormObjectConfiguration |
||
27 | { |
||
28 | /** |
||
29 | * @var FormObject |
||
30 | */ |
||
31 | protected $formObject; |
||
32 | |||
33 | /** |
||
34 | * Contains the form configuration. |
||
35 | * |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $configurationArray = []; |
||
39 | |||
40 | /** |
||
41 | * Contains the form configuration object, which was created from the |
||
42 | * configuration array. |
||
43 | * |
||
44 | * @var ConfigurationObjectInstance |
||
45 | */ |
||
46 | protected $configurationObject; |
||
47 | |||
48 | /** |
||
49 | * @var Result |
||
50 | */ |
||
51 | protected $configurationValidationResult; |
||
52 | |||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | protected $lastConfigurationHash; |
||
57 | |||
58 | /** |
||
59 | * @var ConfigurationFactory |
||
60 | */ |
||
61 | protected $configurationFactory; |
||
62 | |||
63 | /** |
||
64 | * @param FormObject $formObject |
||
65 | * @param array $configurationArray |
||
66 | */ |
||
67 | public function __construct(FormObject $formObject, array $configurationArray) |
||
72 | |||
73 | /** |
||
74 | * Returns an instance of configuration object. Checks if it was previously |
||
75 | * stored in cache, otherwise it is created from scratch. |
||
76 | * |
||
77 | * @return ConfigurationObjectInstance |
||
78 | */ |
||
79 | public function getConfigurationObject() |
||
90 | |||
91 | /** |
||
92 | * This function will merge and return the validation results of both the |
||
93 | * global FormZ configuration object, and this form configuration object. |
||
94 | * |
||
95 | * @return Result |
||
96 | */ |
||
97 | public function getConfigurationValidationResult() |
||
108 | |||
109 | /** |
||
110 | * Resets the validation result and merges it with the global FormZ |
||
111 | * configuration. |
||
112 | * |
||
113 | * @param ConfigurationObjectInstance $configurationObject |
||
114 | * @return Result |
||
115 | */ |
||
116 | protected function refreshConfigurationValidationResult(ConfigurationObjectInstance $configurationObject) |
||
130 | |||
131 | /** |
||
132 | * @return ConfigurationObjectInstance |
||
133 | */ |
||
134 | protected function getConfigurationObjectFromCache() |
||
151 | |||
152 | /** |
||
153 | * @return ConfigurationObjectInstance |
||
154 | */ |
||
155 | protected function buildConfigurationObject() |
||
159 | |||
160 | /** |
||
161 | * This function will clean the configuration array by removing useless data |
||
162 | * and updating needed ones. |
||
163 | * |
||
164 | * @param array $configuration |
||
165 | * @return array |
||
166 | */ |
||
167 | protected function sanitizeConfiguration(array $configuration) |
||
185 | |||
186 | /** |
||
187 | * @param array $configuration |
||
188 | * @return ConfigurationObjectInstance |
||
189 | */ |
||
190 | protected function getConfigurationObjectInstance(array $configuration) |
||
194 | |||
195 | /** |
||
196 | * @return FrontendInterface |
||
197 | */ |
||
198 | protected function getCacheInstance() |
||
202 | |||
203 | /** |
||
204 | * @param ConfigurationFactory $configurationFactory |
||
205 | */ |
||
206 | public function injectConfigurationFactory(ConfigurationFactory $configurationFactory) |
||
210 | |||
211 | public function __sleep() |
||
215 | |||
216 | /** |
||
217 | * When this class is unserialized, the dependencies are injected. |
||
218 | */ |
||
219 | public function __wakeup() |
||
226 | } |
||
227 |