1 | <?php |
||
39 | class FormViewHelperService implements SingletonInterface |
||
40 | { |
||
41 | /** |
||
42 | * @var bool |
||
43 | */ |
||
44 | protected $formContext = false; |
||
45 | |||
46 | /** |
||
47 | * @var FormObject |
||
48 | */ |
||
49 | protected $formObject; |
||
50 | |||
51 | /** |
||
52 | * @var Request |
||
53 | */ |
||
54 | protected $request; |
||
55 | |||
56 | /** |
||
57 | * @var Result |
||
58 | */ |
||
59 | protected $result; |
||
60 | |||
61 | /** |
||
62 | * Reset every state that can be used by this service. |
||
63 | */ |
||
64 | public function resetState() |
||
70 | |||
71 | /** |
||
72 | * Will activate the form context, changing the result returned by the |
||
73 | * function `formContextExists()`. |
||
74 | * |
||
75 | * @return FormViewHelperService |
||
76 | * @throws DuplicateEntryException |
||
77 | */ |
||
78 | public function activateFormContext() |
||
89 | |||
90 | /** |
||
91 | * Returns `true` if the `FormViewHelper` context exists. |
||
92 | * |
||
93 | * @return bool |
||
94 | */ |
||
95 | public function formContextExists() |
||
99 | |||
100 | /** |
||
101 | * Will loop on the submitted form fields and apply behaviours if their |
||
102 | * configuration contains. |
||
103 | */ |
||
104 | public function applyBehavioursOnSubmittedForm() |
||
128 | |||
129 | /** |
||
130 | * Takes care of injecting data for the form. |
||
131 | * |
||
132 | * If the form was generated using a content object, information about it |
||
133 | * are injected, to be retrieved later to be able for instance to fetch the |
||
134 | * object settings (TypoScript, FlexForm, ...). |
||
135 | */ |
||
136 | public function injectFormRequestData() |
||
154 | |||
155 | /** |
||
156 | * Fetches all data attributes that are bound to the form: fields values, |
||
157 | * validation result and others. |
||
158 | * |
||
159 | * @param DataAttributesAssetHandler $dataAttributesAssetHandler |
||
160 | * @return array |
||
161 | */ |
||
162 | public function getDataAttributes(DataAttributesAssetHandler $dataAttributesAssetHandler) |
||
192 | |||
193 | /** |
||
194 | * Returns the list of fields that have been added below the form view |
||
195 | * helper. |
||
196 | * |
||
197 | * @param ViewHelperVariableContainer $variableContainer |
||
198 | * @return array |
||
199 | */ |
||
200 | public function getCurrentFormFieldNames(ViewHelperVariableContainer $variableContainer) |
||
222 | |||
223 | /** |
||
224 | * @return FormObject |
||
225 | */ |
||
226 | public function getFormObject() |
||
230 | |||
231 | /** |
||
232 | * @param FormObject $formObject |
||
233 | */ |
||
234 | public function setFormObject(FormObject $formObject) |
||
238 | |||
239 | /** |
||
240 | * @param Request $request |
||
241 | */ |
||
242 | public function setRequest(Request $request) |
||
246 | |||
247 | /** |
||
248 | * @return Result |
||
249 | */ |
||
250 | public function getResult() |
||
254 | |||
255 | /** |
||
256 | * @return FormResult |
||
257 | */ |
||
258 | protected function getFormValidationResult() |
||
264 | |||
265 | /** |
||
266 | * @param string $formName |
||
267 | * @return AbstractFormValidator |
||
268 | */ |
||
269 | protected function getFormValidator($formName) |
||
282 | } |
||
283 |