1 | <?php |
||
30 | class FormObject |
||
31 | { |
||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $name; |
||
36 | |||
37 | /** |
||
38 | * @var FormObjectStatic |
||
39 | */ |
||
40 | protected $static; |
||
41 | |||
42 | /** |
||
43 | * @var FormObjectProxy |
||
44 | */ |
||
45 | protected $proxy; |
||
46 | |||
47 | /** |
||
48 | * @var FormObjectFactory |
||
49 | */ |
||
50 | protected $formObjectFactory; |
||
51 | |||
52 | /** |
||
53 | * You should never create a new instance of this class directly, use the |
||
54 | * `FormObjectFactory->getInstanceFromClassName()` function instead. |
||
55 | * |
||
56 | * @param string $name |
||
57 | * @param FormObjectStatic $static |
||
58 | */ |
||
59 | public function __construct($name, FormObjectStatic $static) |
||
66 | |||
67 | /** |
||
68 | * @return string |
||
69 | */ |
||
70 | public function getName() |
||
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | public function getClassName() |
||
82 | |||
83 | /** |
||
84 | * @return Form |
||
85 | */ |
||
86 | public function getConfiguration() |
||
90 | |||
91 | /** |
||
92 | * @return Result |
||
93 | */ |
||
94 | public function getConfigurationValidationResult() |
||
98 | |||
99 | /** |
||
100 | * @return FormObjectRequestData |
||
101 | */ |
||
102 | public function getRequestData() |
||
106 | |||
107 | /** |
||
108 | * @return FormInterface |
||
109 | */ |
||
110 | public function getForm() |
||
114 | |||
115 | /** |
||
116 | * @return bool |
||
117 | */ |
||
118 | public function hasForm() |
||
122 | |||
123 | /** |
||
124 | * @param FormInterface $form |
||
125 | */ |
||
126 | public function setForm(FormInterface $form) |
||
130 | |||
131 | /** |
||
132 | * Will mark the form as submitted (change the result returned by the |
||
133 | * function `formWasSubmitted()`). |
||
134 | */ |
||
135 | public function markFormAsSubmitted() |
||
139 | |||
140 | /** |
||
141 | * Returns `true` if the form was submitted by the user. |
||
142 | * |
||
143 | * @return bool |
||
144 | */ |
||
145 | public function formWasSubmitted() |
||
149 | |||
150 | /** |
||
151 | * @return FormResult |
||
152 | */ |
||
153 | public function getFormResult() |
||
157 | |||
158 | /** |
||
159 | * @return bool |
||
160 | */ |
||
161 | public function hasFormResult() |
||
165 | |||
166 | /** |
||
167 | * @param FormResult $formResult |
||
168 | */ |
||
169 | public function setFormResult($formResult) |
||
173 | |||
174 | /** |
||
175 | * @return FormMetadata |
||
176 | */ |
||
177 | public function getMetadata() |
||
181 | |||
182 | /** |
||
183 | * @param string $hash |
||
184 | */ |
||
185 | public function setFormHash($hash) |
||
189 | |||
190 | /** |
||
191 | * @return string |
||
192 | */ |
||
193 | public function getFormHash() |
||
197 | |||
198 | /** |
||
199 | * Returns a unique hash for this form object. |
||
200 | * |
||
201 | * @return string |
||
202 | */ |
||
203 | public function getObjectHash() |
||
207 | |||
208 | /** |
||
209 | * @return PersistenceManager |
||
210 | */ |
||
211 | public function getPersistenceManager() |
||
215 | |||
216 | /** |
||
217 | * @return FormObjectProxy |
||
218 | */ |
||
219 | public function getProxy() |
||
225 | |||
226 | /** |
||
227 | * @param FormObjectFactory $formObjectFactory |
||
228 | */ |
||
229 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
233 | } |
||
234 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: