1 | <?php |
||
27 | class FormController extends ActionController |
||
28 | { |
||
29 | /** |
||
30 | * @var FormObject[] |
||
31 | */ |
||
32 | protected $formArguments = []; |
||
33 | |||
34 | /** |
||
35 | * @var FormzControllerContext |
||
36 | */ |
||
37 | protected $formzControllerContext; |
||
38 | |||
39 | /** |
||
40 | * @var HashService |
||
41 | */ |
||
42 | protected $hashService; |
||
43 | |||
44 | /** |
||
45 | * @var FormObjectFactory |
||
46 | */ |
||
47 | protected $formObjectFactory; |
||
48 | |||
49 | /** |
||
50 | * Main action used to dispatch the request properly, depending on FormZ |
||
51 | * configuration. |
||
52 | * |
||
53 | * The request is based on the previously called controller action, and is |
||
54 | * used to list which forms are handled (every argument of the action method |
||
55 | * that implements the interface `FormInterface`). |
||
56 | * |
||
57 | * Middlewares will be called for each form argument, and may modify the |
||
58 | * request, which is then dispatched again with modified data. |
||
59 | */ |
||
60 | public function processFormAction() |
||
89 | |||
90 | /** |
||
91 | * Will fetch every form argument for this request, and dispatch every |
||
92 | * middleware that was registered in its TypoScript configuration. |
||
93 | */ |
||
94 | protected function invokeMiddlewares() |
||
112 | |||
113 | /** |
||
114 | * Will check if the request result contains error; if errors are found, the |
||
115 | * request is forwarded to the referring request, with the arguments of the |
||
116 | * current request. |
||
117 | */ |
||
118 | protected function manageRequestResult() |
||
128 | |||
129 | /** |
||
130 | * Forwards the request to the referrer request. It will also fill the |
||
131 | * arguments of the action with the one from the source request. |
||
132 | */ |
||
133 | protected function forwardToReferrer() |
||
144 | |||
145 | /** |
||
146 | * Loops on the request arguments, and pick up each one that is a form |
||
147 | * instance (it implements `FormInterface`). |
||
148 | * |
||
149 | * @return FormObject[] |
||
150 | */ |
||
151 | protected function getRequestForms() |
||
172 | |||
173 | /** |
||
174 | * @todo |
||
175 | * |
||
176 | * @return array |
||
177 | */ |
||
178 | protected function getRequestData() |
||
190 | |||
191 | /** |
||
192 | * @param RedirectException $redirectException |
||
193 | */ |
||
194 | protected function redirectFromException(RedirectException $redirectException) |
||
206 | |||
207 | /** |
||
208 | * @param FormzControllerContext $formzControllerContext |
||
209 | */ |
||
210 | public function injectFormzControllerContext(FormzControllerContext $formzControllerContext) |
||
214 | |||
215 | /** |
||
216 | * @param HashService $hashService |
||
217 | */ |
||
218 | public function injectHashService(HashService $hashService) |
||
222 | |||
223 | /** |
||
224 | * @param FormObjectFactory $formObjectFactory |
||
225 | */ |
||
226 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
230 | } |
||
231 |
Unless you are absolutely sure that the expression can never be null because of other conditions, we strongly recommend to add an additional type check to your code: