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