Uh oh!
There was an error while loading. Please reload this page.
forked from symfony/form
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormInterface.php
More file actions
Latest commit
241 lines (210 loc) · 5.25 KB
/
Copy pathFormInterface.php
File metadata and controls
241 lines (210 loc) · 5.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespaceSymfony\Component\Form;
/**
* A form group bundling multiple form forms
*
* @author Bernhard Schussek <bernhard.schussek@symfony.com>
*/
interface FormInterface extends \ArrayAccess, \Traversable, \Countable
{
/**
* Sets the parent form.
*
* @param FormInterface $parent The parent form
*/
functionsetParent(FormInterface$parent = null);
/**
* Returns the parent form.
*
* @return FormInterface The parent form
*/
functiongetParent();
/**
* Returns whether the form has a parent.
*
* @return Boolean
*/
functionhasParent();
/**
* Adds a child to the form.
*
* @param FormInterface $child The FormInterface to add as a child
*/
functionadd(FormInterface$child);
/**
* Returns whether a child with the given name exists.
*
* @param string $name
*
* @return Boolean
*/
functionhas($name);
/**
* Removes a child from the form.
*
* @param string $name The name of the child to remove
*/
functionremove($name);
/**
* Returns all children in this group.
*
* @return array An array of FormInterface instances
*/
functiongetChildren();
/**
* Return whether the form has children.
*
* @return Boolean
*/
functionhasChildren();
/**
* Returns all errors.
*
* @return array An array of FormError instances that occurred during binding
*/
functiongetErrors();
/**
* Updates the field with default data.
*
* @param array $appData The data formatted as expected for the underlying object
*
* @return Form The current form
*/
functionsetData($appData);
/**
* Returns the data in the format needed for the underlying object.
*
* @return mixed
*/
functiongetData();
/**
* Returns the normalized data of the field.
*
* @return mixed When the field is not bound, the default data is returned.
* When the field is bound, the normalized bound data is
* returned if the field is valid, null otherwise.
*/
functiongetNormData();
/**
* Returns the data transformed by the value transformer.
*
* @return string
*/
functiongetClientData();
/**
* Returns the extra data.
*
* @return array The bound data which do not belong to a child
*/
functiongetExtraData();
/**
* Returns whether the field is bound.
*
* @return Boolean true if the form is bound to input values, false otherwise
*/
functionisBound();
/**
* Returns the supported types.
*
* @return array An array of FormTypeInterface
*/
functiongetTypes();
/**
* Returns the name by which the form is identified in forms.
*
* @return string The name of the form.
*/
functiongetName();
/**
* Adds an error to this form.
*
* @param FormError $error
*/
functionaddError($error);
/**
* Returns whether the form is valid.
*
* @return Boolean
*/
functionisValid();
/**
* Returns whether the form is required to be filled out.
*
* If the form has a parent and the parent is not required, this method
* will always return false. Otherwise the value set with setRequired()
* is returned.
*
* @return Boolean
*/
functionisRequired();
/**
* Returns whether this form can be read only.
*
* The content of a read-only form is displayed, but not allowed to be
* modified. The validation of modified read-only forms should fail.
*
* Fields whose parents are read-only are considered read-only regardless of
* their own state.
*
* @return Boolean
*/
functionisReadOnly();
/**
* Returns whether the form is empty.
*
* @return Boolean
*/
functionisEmpty();
/**
* Returns whether the data in the different formats is synchronized.
*
* @return Boolean
*/
functionisSynchronized();
/**
* Writes data into the form.
*
* @param mixed $data The data
*/
functionbind($data);
/**
* Returns whether the form has an attribute with the given name.
*
* @param string $name The name of the attribute
*/
functionhasAttribute($name);
/**
* Returns the value of the attributes with the given name.
*
* @param string $name The name of the attribute
*/
functiongetAttribute($name);
/**
* Returns the root of the form tree.
*
* @return FormInterface The root of the tree
*/
functiongetRoot();
/**
* Returns whether the field is the root of the form tree.
*
* @return Boolean
*/
functionisRoot();
/**
* Creates a view.
*
* @param FormView $parent The parent view
*
* @return FormView The view
*/
functioncreateView(FormView$parent = null);
}