1 | <?php |
||
31 | class FormObject |
||
32 | { |
||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $name; |
||
37 | |||
38 | /** |
||
39 | * @var FormObjectStatic |
||
40 | */ |
||
41 | protected $static; |
||
42 | |||
43 | /** |
||
44 | * @var FormObjectProxy |
||
45 | */ |
||
46 | protected $proxy; |
||
47 | |||
48 | /** |
||
49 | * @var FormObjectFactory |
||
50 | */ |
||
51 | protected $formObjectFactory; |
||
52 | |||
53 | /** |
||
54 | * @var PersistenceManager |
||
55 | */ |
||
56 | protected $persistenceManager; |
||
57 | |||
58 | /** |
||
59 | * You should never create a new instance of this class directly, use the |
||
60 | * `FormObjectFactory->getInstanceFromClassName()` function instead. |
||
61 | * |
||
62 | * @param string $name |
||
63 | * @param FormObjectStatic $static |
||
64 | */ |
||
65 | public function __construct($name, FormObjectStatic $static) |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | */ |
||
77 | public function getName() |
||
81 | |||
82 | /** |
||
83 | * @return string |
||
84 | */ |
||
85 | public function getClassName() |
||
89 | |||
90 | /** |
||
91 | * @return Form |
||
92 | */ |
||
93 | public function getConfiguration() |
||
97 | |||
98 | /** |
||
99 | * @return Result |
||
100 | */ |
||
101 | public function getConfigurationValidationResult() |
||
105 | |||
106 | /** |
||
107 | * @return FormInterface |
||
108 | */ |
||
109 | public function getForm() |
||
113 | |||
114 | /** |
||
115 | * @return bool |
||
116 | */ |
||
117 | public function hasForm() |
||
121 | |||
122 | /** |
||
123 | * @param FormInterface $form |
||
124 | */ |
||
125 | public function setForm(FormInterface $form) |
||
129 | |||
130 | /** |
||
131 | * Will mark the form as submitted (change the result returned by the |
||
132 | * function `formWasSubmitted()`). |
||
133 | */ |
||
134 | public function markFormAsSubmitted() |
||
138 | |||
139 | /** |
||
140 | * Returns `true` if the form was submitted by the user. |
||
141 | * |
||
142 | * @return bool |
||
143 | */ |
||
144 | public function formWasSubmitted() |
||
148 | |||
149 | /** |
||
150 | * @return FormResult |
||
151 | */ |
||
152 | public function getFormResult() |
||
156 | |||
157 | /** |
||
158 | * @return bool |
||
159 | */ |
||
160 | public function hasFormResult() |
||
164 | |||
165 | /** |
||
166 | * @param FormResult $formResult |
||
167 | */ |
||
168 | public function setFormResult(FormResult $formResult) |
||
172 | |||
173 | /** |
||
174 | * @return FormObjectRequestData |
||
175 | */ |
||
176 | public function getRequestData() |
||
180 | |||
181 | /** |
||
182 | * @return FormMetadata |
||
183 | */ |
||
184 | public function getMetadata() |
||
188 | |||
189 | /** |
||
190 | * @param FormMetadata $metadata |
||
191 | */ |
||
192 | public function setMetadata(FormMetadata $metadata) |
||
196 | |||
197 | /** |
||
198 | * @return string |
||
199 | */ |
||
200 | public function getFormHash() |
||
204 | |||
205 | /** |
||
206 | * Returns a unique hash for this form object. |
||
207 | * |
||
208 | * @return string |
||
209 | */ |
||
210 | public function getObjectHash() |
||
214 | |||
215 | /** |
||
216 | * @return PersistenceManager |
||
217 | */ |
||
218 | public function getPersistenceManager() |
||
222 | |||
223 | /** |
||
224 | * @return FormObjectProxy |
||
225 | * @throws PropertyNotAccessibleException |
||
226 | */ |
||
227 | protected function getProxy() |
||
235 | |||
236 | /** |
||
237 | * @param FormObjectFactory $formObjectFactory |
||
238 | */ |
||
239 | public function injectFormObjectFactory(FormObjectFactory $formObjectFactory) |
||
243 | } |
||
244 |
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: