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 $realRequest; |
||
55 | |||
56 | /** |
||
57 | * @var Request |
||
58 | */ |
||
59 | protected $originalRequest; |
||
60 | |||
61 | /** |
||
62 | * @var Arguments |
||
63 | */ |
||
64 | protected $requestArguments; |
||
65 | |||
66 | /** |
||
67 | * @var array |
||
68 | */ |
||
69 | protected $settings = []; |
||
70 | |||
71 | /** |
||
72 | * @todo |
||
73 | * |
||
74 | * @param MvcRequest $request |
||
75 | * @param Arguments $requestArguments |
||
76 | * @param array $settings |
||
77 | * @return $this |
||
78 | */ |
||
79 | public function setData(MvcRequest $request, Arguments $requestArguments, array $settings) |
||
90 | |||
91 | /** |
||
92 | * @todo |
||
93 | * |
||
94 | * @throws StopActionException |
||
95 | */ |
||
96 | public function dispatch() |
||
115 | |||
116 | /** |
||
117 | * Will check if the form objects found in the request arguments contain |
||
118 | * configuration errors. If they do, we dispatch the request to the error |
||
119 | * view, where all errors will be explained properly to the user. |
||
120 | */ |
||
121 | protected function checkFormObjectsErrors() |
||
132 | |||
133 | /** |
||
134 | * Loops on the request arguments, and pick up each one that is a form |
||
135 | * instance (it implements `FormInterface`). |
||
136 | * |
||
137 | * @return FormObject[] |
||
138 | */ |
||
139 | public function getRequestForms() |
||
160 | |||
161 | /** |
||
162 | * @return Request |
||
163 | */ |
||
164 | public function getRequest() |
||
168 | |||
169 | /** |
||
170 | * @return Arguments |
||
171 | */ |
||
172 | public function getRequestArguments() |
||
173 | { |
||
174 | return $this->requestArguments; |
||
175 | } |
||
176 | |||
177 | /** |
||
178 | * @return array |
||
179 | */ |
||
180 | public function getSettings() |
||
184 | |||
185 | /** |
||
186 | * @param FormObjectFactory $formObjectFactory |
||
187 | */ |
||
188 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
192 | } |
||
193 |