class FormBuilder
Methods
|
__construct(string $name, FormFactoryInterface $factory, EventDispatcherInterface $dispatcher, string $dataClass = null)
Constructor. |
||
| FormFactoryInterface |
getFormFactory()
Returns the associated form factory. |
|
| string |
getName()
Returns the name of the form. |
|
| FormBuilder |
setData(array $appData)
Updates the field with default data. |
|
| mixed |
getData()
Returns the data in the format needed for the underlying object. |
|
| FormBuilder |
setReadOnly(Boolean $readOnly)
Set whether the form is read only |
|
| Boolean |
getReadOnly()
Returns whether the form is read only. |
|
| FormBuilder |
setRequired(Boolean $required)
Sets whether this field is required to be filled out when bound. |
|
| Boolean |
getRequired()
Returns whether this field is required to be filled out when bound. |
|
| FormBuilder |
setErrorBubbling(type $errorBubbling)
Sets whether errors bubble up to the parent. |
|
| Boolean |
getErrorBubbling()
Returns whether errors bubble up to the parent. |
|
| FormBuilder |
addValidator(FormValidatorInterface $validator)
Adds a validator to the form. |
|
| array |
getValidators()
Returns the validators used by the form. |
|
| FormBuilder |
addEventListener($eventName, $listener, $priority)
Adds an event listener for events on this field |
|
| FormBuilder |
addEventSubscriber(EventSubscriberInterface $subscriber)
Adds an event subscriber for events on this field |
|
| FormBuilder |
appendNormTransformer(DataTransformerInterface $normTransformer)
Appends a transformer to the normalization transformer chain |
|
| FormBuilder |
prependNormTransformer(DataTransformerInterface $normTransformer)
Prepends a transformer to the client transformer chain |
|
| FormBuilder |
resetNormTransformers()
Clears the normalization transformers. |
|
| array |
getNormTransformers()
Returns all the normalization transformers. |
|
| FormBuilder |
appendClientTransformer(DataTransformerInterface $clientTransformer)
Appends a transformer to the client transformer chain |
|
| FormBuilder |
prependClientTransformer(DataTransformerInterface $clientTransformer)
Prepends a transformer to the client transformer chain |
|
| FormBuilder |
resetClientTransformers()
Clears the client transformers. |
|
| array |
getClientTransformers()
Returns all the client transformers. |
|
| FormBuilder |
setAttribute(string $name, string $value)
Sets the value for an attribute. |
|
|
getAttribute(string $name)
Returns the value of the attributes with the given name. |
||
|
hasAttribute(string $name)
Returns whether the form has an attribute with the given name. |
||
| array |
getAttributes()
Returns all the attributes. |
|
| FormBuilder |
setDataMapper(DataMapperInterface $dataMapper)
Sets the data mapper used by the form. |
|
| array |
getDataMapper()
Returns the data mapper used by the form. |
|
| FormBuilder |
setTypes(array $types)
Set the types. |
|
| array |
getTypes()
Return the types. |
|
|
setEmptyData(mixed $emptyData)
Sets the data used for the client data when no value is bound. |
||
| mixed |
getEmptyData()
Returns the data used for the client data when no value is bound. |
|
| FormBuilder |
add(string|FormBuilder $child, string|FormTypeInterface $type = null, array $options = array())
Adds a new field to this group. |
|
| FormBuilder |
create(string $name, string|FormTypeInterface $type = null, array $options = array())
Creates a form builder. |
|
| FormBuilder |
get(string $name)
Returns a child by name. |
|
| FormBuilder |
remove(string $name)
Removes the field with the given name. |
|
| Boolean |
has(string $name)
Returns whether a field with the given name exists. |
|
| Form |
getForm()
Creates the form. |
|
| setCurrentLoadingType($type) |
Details
at line 124
public
__construct(string $name, FormFactoryInterface $factory, EventDispatcherInterface $dispatcher, string $dataClass = null)
Constructor.
at line 137
public FormFactoryInterface
getFormFactory()
Returns the associated form factory.
at line 147
public string
getName()
Returns the name of the form.
at line 159
public FormBuilder
setData(array $appData)
Updates the field with default data.
at line 171
public mixed
getData()
Returns the data in the format needed for the underlying object.
at line 183
public FormBuilder
setReadOnly(Boolean $readOnly)
Set whether the form is read only
at line 195
public Boolean
getReadOnly()
Returns whether the form is read only.
at line 207
public FormBuilder
setRequired(Boolean $required)
Sets whether this field is required to be filled out when bound.
at line 219
public Boolean
getRequired()
Returns whether this field is required to be filled out when bound.
at line 231
public FormBuilder
setErrorBubbling(type $errorBubbling)
Sets whether errors bubble up to the parent.
at line 243
public Boolean
getErrorBubbling()
Returns whether errors bubble up to the parent.
at line 255
public FormBuilder
addValidator(FormValidatorInterface $validator)
Adds a validator to the form.
at line 267
public array
getValidators()
Returns the validators used by the form.
at line 279
public FormBuilder
addEventListener($eventName, $listener, $priority)
Adds an event listener for events on this field
at line 293
public FormBuilder
addEventSubscriber(EventSubscriberInterface $subscriber)
Adds an event subscriber for events on this field
at line 307
public FormBuilder
appendNormTransformer(DataTransformerInterface $normTransformer)
Appends a transformer to the normalization transformer chain
at line 321
public FormBuilder
prependNormTransformer(DataTransformerInterface $normTransformer)
Prepends a transformer to the client transformer chain
at line 333
public FormBuilder
resetNormTransformers()
Clears the normalization transformers.
at line 345
public array
getNormTransformers()
Returns all the normalization transformers.
at line 357
public FormBuilder
appendClientTransformer(DataTransformerInterface $clientTransformer)
Appends a transformer to the client transformer chain
at line 371
public FormBuilder
prependClientTransformer(DataTransformerInterface $clientTransformer)
Prepends a transformer to the client transformer chain
at line 383
public FormBuilder
resetClientTransformers()
Clears the client transformers.
at line 395
public array
getClientTransformers()
Returns all the client transformers.
at line 408
public FormBuilder
setAttribute(string $name, string $value)
Sets the value for an attribute.
at line 420
public
getAttribute(string $name)
Returns the value of the attributes with the given name.
at line 430
public
hasAttribute(string $name)
Returns whether the form has an attribute with the given name.
at line 440
public array
getAttributes()
Returns all the attributes.
at line 452
public FormBuilder
setDataMapper(DataMapperInterface $dataMapper)
Sets the data mapper used by the form.
at line 464
public array
getDataMapper()
Returns the data mapper used by the form.
at line 476
public FormBuilder
setTypes(array $types)
Set the types.
at line 488
public array
getTypes()
Return the types.
at line 498
public
setEmptyData(mixed $emptyData)
Sets the data used for the client data when no value is bound.
at line 510
public mixed
getEmptyData()
Returns the data used for the client data when no value is bound.
at line 528
public FormBuilder
add(string|FormBuilder $child, string|FormTypeInterface $type = null, array $options = array())
Adds a new field to this group.
A field must have a unique name within
the group. Otherwise the existing field is overwritten.
If you add a nested group, this group should also be represented in the
object hierarchy.
at line 565
public FormBuilder
create(string $name, string|FormTypeInterface $type = null, array $options = array())
Creates a form builder.
at line 587
public FormBuilder
get(string $name)
Returns a child by name.
at line 611
public FormBuilder
remove(string $name)
Removes the field with the given name.
at line 627
public Boolean
has(string $name)
Returns whether a field with the given name exists.
at line 637
public Form
getForm()
Creates the form.