/
FormConfigInterface.php
171 lines (149 loc) · 4.1 KB
/
FormConfigInterface.php
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
<?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.
*/
namespace Symfony\Component\Form;
/**
* The configuration of a {@link Form} object.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
interface FormConfigInterface
{
/**
* Returns the event dispatcher used to dispatch form events.
*
* @return \Symfony\Component\EventDispatcher\EventDispatcherInterface The dispatcher.
*/
function getEventDispatcher();
/**
* Returns the name of the form used as HTTP parameter.
*
* @return string The form name.
*/
function getName();
/**
* Returns the property path that the form should be mapped to.
*
* @return Util\PropertyPath The property path.
*/
function getPropertyPath();
/**
* Returns whether the form should be mapped to an element of its
* parent's data.
*
* @return Boolean Whether the form is mapped.
*/
function getMapped();
/**
* Returns whether the form's data should be modified by reference.
*
* @return Boolean Whether to modify the form's data by reference.
*/
function getByReference();
/**
* Returns whether the form should be virtual.
*
* When mapping data to the children of a form, the data mapper
* should ignore virtual forms and map to the children of the
* virtual form instead.
*
* @return Boolean Whether the form is virtual.
*/
function getVirtual();
/**
* Returns the form types used to construct the form.
*
* @return array An array of {@link FormTypeInterface} instances.
*/
function getTypes();
/**
* Returns the client transformers of the form.
*
* @return array An array of {@link DataTransformerInterface} instances.
*/
function getClientTransformers();
/**
* Returns the view transformers of the form.
*
* @return array An array of {@link DataTransformerInterface} instances.
*/
function getNormTransformers();
/**
* Returns the data mapper of the form.
*
* @return DataMapperInterface The data mapper.
*/
function getDataMapper();
/**
* Returns the validators of the form.
*
* @return FormValidatorInterface The form validator.
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
function getValidators();
/**
* Returns whether the form is required.
*
* @return Boolean Whether the form is required.
*/
function getRequired();
/**
* Returns whether the form is disabled.
*
* @return Boolean Whether the form is disabled.
*/
function getDisabled();
/**
* Returns whether errors attached to the form will bubble to its parent.
*
* @return Boolean Whether errors will bubble up.
*/
function getErrorBubbling();
/**
* Returns the data that should be returned when the form is empty.
*
* @return mixed The data returned if the form is empty.
*/
function getEmptyData();
/**
* Returns additional attributes of the form.
*
* @return array An array of key-value combinations.
*/
function getAttributes();
/**
* Returns whether the attribute with the given name exists.
*
* @param string $name The attribute name.
*
* @return Boolean Whether the attribute exists.
*/
function hasAttribute($name);
/**
* Returns the value of the given attribute.
*
* @param string $name The attribute name.
*
* @return mixed The attribute value.
*/
function getAttribute($name);
/**
* Returns the initial data of the form.
*
* @return mixed The initial form data.
*/
function getData();
/**
* Returns the class of the form data or null if the data is scalar or an array.
*
* @return string The data class or null.
*/
function getDataClass();
}