1 | <?php |
||
27 | class ControllerState implements SingletonInterface |
||
28 | { |
||
29 | use ExtendedSelfInstantiateTrait; |
||
30 | |||
31 | /** |
||
32 | * @var FormObjectFactory |
||
33 | */ |
||
34 | protected $formObjectFactory; |
||
35 | |||
36 | /** |
||
37 | * @var FormObject[] |
||
38 | */ |
||
39 | protected $formArguments = []; |
||
40 | |||
41 | /** |
||
42 | * @var bool |
||
43 | */ |
||
44 | protected $dispatched = false; |
||
45 | |||
46 | /** |
||
47 | * @var Request |
||
48 | */ |
||
49 | protected $request; |
||
50 | |||
51 | /** |
||
52 | * @var Request |
||
53 | */ |
||
54 | protected $originalRequest; |
||
55 | |||
56 | /** |
||
57 | * @var Arguments |
||
58 | */ |
||
59 | protected $arguments; |
||
60 | |||
61 | /** |
||
62 | * @var array |
||
63 | */ |
||
64 | protected $settings = []; |
||
65 | |||
66 | /** |
||
67 | * @todo |
||
68 | * |
||
69 | * @param MvcRequest $request |
||
70 | * @param Arguments $arguments |
||
71 | * @param array $settings |
||
72 | * @throws StopActionException |
||
73 | */ |
||
74 | public function dispatch(MvcRequest $request, Arguments $arguments, array $settings) |
||
99 | |||
100 | /** |
||
101 | * Will check if the form objects found in the request arguments contain |
||
102 | * configuration errors. If they do, we dispatch the request to the error |
||
103 | * view, where all errors will be explained properly to the user. |
||
104 | * |
||
105 | * @param MvcRequest $request |
||
106 | */ |
||
107 | protected function checkFormObjectsErrors(MvcRequest $request) |
||
118 | |||
119 | /** |
||
120 | * Loops on the request arguments, and pick up each one that is a form |
||
121 | * instance (it implements `FormInterface`). |
||
122 | * |
||
123 | * @return FormObject[] |
||
124 | */ |
||
125 | public function getRequestForms() |
||
146 | |||
147 | /** |
||
148 | * @return Request |
||
149 | */ |
||
150 | public function getRequest() |
||
154 | |||
155 | /** |
||
156 | * @return Arguments |
||
157 | */ |
||
158 | public function getArguments() |
||
162 | |||
163 | /** |
||
164 | * @return array |
||
165 | */ |
||
166 | public function getSettings() |
||
170 | |||
171 | /** |
||
172 | * @param FormObjectFactory $formObjectFactory |
||
173 | */ |
||
174 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
178 | } |
||
179 |