1 | <?php |
||
29 | class FormObjectProxy |
||
30 | { |
||
31 | /** |
||
32 | * @var FormObject |
||
33 | */ |
||
34 | protected $formObject; |
||
35 | |||
36 | /** |
||
37 | * @var FormInterface |
||
38 | */ |
||
39 | protected $form; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $formHash; |
||
45 | |||
46 | /** |
||
47 | * @var bool |
||
48 | */ |
||
49 | protected $formWasSubmitted = false; |
||
50 | |||
51 | /** |
||
52 | * @var bool |
||
53 | */ |
||
54 | protected $formWasValidated = false; |
||
55 | /** |
||
56 | * @var FormResult |
||
57 | */ |
||
58 | protected $formResult; |
||
59 | |||
60 | /** |
||
61 | * @var FormObjectRequestData |
||
62 | */ |
||
63 | protected $requestData; |
||
64 | |||
65 | /** |
||
66 | * @var FormObjectMetadata |
||
67 | */ |
||
68 | protected $metadata; |
||
69 | |||
70 | /** |
||
71 | * @var bool |
||
72 | */ |
||
73 | protected $formIsPersistent = false; |
||
74 | |||
75 | /** |
||
76 | * @var FormObjectSteps |
||
77 | */ |
||
78 | protected $stepService; |
||
79 | |||
80 | /** |
||
81 | * @param FormObject $formObject |
||
82 | * @param FormInterface $form |
||
83 | */ |
||
84 | public function __construct(FormObject $formObject, FormInterface $form) |
||
85 | { |
||
86 | $this->formObject = $formObject; |
||
87 | $this->form = $form; |
||
88 | $this->stepService = Core::instantiate(FormObjectSteps::class, $formObject); |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @return FormInterface |
||
93 | */ |
||
94 | public function getForm() |
||
98 | |||
99 | /** |
||
100 | * Will mark the form as submitted (change the result returned by the |
||
101 | * function `formWasSubmitted()`). |
||
102 | * |
||
103 | * @internal |
||
104 | */ |
||
105 | public function markFormAsSubmitted() |
||
109 | |||
110 | /** |
||
111 | * Returns `true` if the form was submitted by the user. |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | public function formWasSubmitted() |
||
119 | |||
120 | /** |
||
121 | * Marks the form as validated. |
||
122 | * |
||
123 | * @internal |
||
124 | */ |
||
125 | public function markFormAsValidated() |
||
129 | |||
130 | /** |
||
131 | * @return bool |
||
132 | */ |
||
133 | public function formWasValidated() |
||
137 | |||
138 | /** |
||
139 | * @internal |
||
140 | */ |
||
141 | public function markFormAsPersistent() |
||
145 | |||
146 | /** |
||
147 | * @return bool |
||
148 | */ |
||
149 | public function formIsPersistent() |
||
153 | |||
154 | /** |
||
155 | * @return FormResult |
||
156 | */ |
||
157 | public function getFormResult() |
||
165 | |||
166 | /** |
||
167 | * @return FormObjectRequestData |
||
168 | */ |
||
169 | public function getRequestData() |
||
173 | |||
174 | /** |
||
175 | * @return FormMetadata |
||
176 | */ |
||
177 | public function getFormMetadata() |
||
185 | |||
186 | /** |
||
187 | * @return Step|null |
||
188 | */ |
||
189 | public function getCurrentStep() |
||
193 | |||
194 | /** |
||
195 | * @param Request $request |
||
196 | */ |
||
197 | public function fetchCurrentStep(Request $request) |
||
201 | |||
202 | /** |
||
203 | * @return SubstepDefinition |
||
204 | */ |
||
205 | public function getCurrentSubstepDefinition() |
||
209 | |||
210 | /** |
||
211 | * @param SubstepDefinition $currentSubstepDefinition |
||
212 | */ |
||
213 | public function setCurrentSubstepDefinition(SubstepDefinition $currentSubstepDefinition) |
||
217 | |||
218 | /** |
||
219 | * @return FormStepPersistence |
||
220 | */ |
||
221 | public function getStepPersistence() |
||
225 | |||
226 | /** |
||
227 | * @return string |
||
228 | */ |
||
229 | public function getFormHash() |
||
237 | |||
238 | /** |
||
239 | * @param string $hash |
||
240 | */ |
||
241 | public function setFormHash($hash) |
||
245 | |||
246 | /** |
||
247 | * @param FormObjectRequestData $requestData |
||
248 | */ |
||
249 | public function injectRequestData(FormObjectRequestData $requestData) |
||
253 | } |
||
254 |