FormConfigBuilderInterface
interface FormConfigBuilderInterface implements FormConfigInterface
Methods
Returns the event dispatcher used to dispatch form events.
Returns the property path that the form should be mapped to.
Returns whether the form should be mapped to an element of its parent's data.
Returns whether the form's data should be modified by reference.
Returns whether the form should read and write the data of its parent.
Returns the form types used to construct the form.
Returns the view transformers of the form.
Returns the model transformers of the form.
Returns whether errors attached to the form will bubble to its parent.
Returns the data that should be returned when the form is empty.
Returns whether the attribute with the given name exists.
Returns the value of the given attribute.
Returns the class of the form data or null if the data is scalar or an array.
Returns the form factory used for creating new forms.
Returns the request handler used by the form.
Returns whether the form should be initialized upon creation.
Returns all options passed during the construction of the form.
Returns the value of a specific option.
Adds an event listener to an event on this form.
Adds an event subscriber for events on this form.
Appends / prepends a transformer to the view transformer chain.
Clears the view transformers.
Prepends / appends a transformer to the normalization transformer chain.
Clears the normalization transformers.
Sets the value for an attribute.
Sets the attributes.
Set whether the form is disabled.
Sets the data used for the client data when no value is submitted.
Sets whether errors bubble up to the parent.
Sets whether this field is required to be filled out when submitted.
Sets the property path that the form should be mapped to.
Sets whether the form should be mapped to an element of its parent's data.
Sets whether the form's data should be modified by reference.
Sets whether the form should read and write the data of its parent.
Sets whether the form should be compound.
Sets the initial data of the form.
Locks the form's data to the data passed in the configuration.
Sets the form factory used for creating new forms.
Sets the target URL of the form.
Sets the HTTP method used by the form.
Sets the request handler used by the form.
Sets whether the form should be initialized automatically.
Builds and returns the form configuration.
Details
in FormConfigInterface at line line 29
EventDispatcherInterface
getEventDispatcher()
Returns the event dispatcher used to dispatch form events.
in FormConfigInterface at line line 36
string
getName()
Returns the name of the form used as HTTP parameter.
in FormConfigInterface at line line 43
null|PropertyPathInterface
getPropertyPath()
Returns the property path that the form should be mapped to.
in FormConfigInterface at line line 51
bool
getMapped()
Returns whether the form should be mapped to an element of its parent's data.
in FormConfigInterface at line line 58
bool
getByReference()
Returns whether the form's data should be modified by reference.
in FormConfigInterface at line line 65
bool
getInheritData()
Returns whether the form should read and write the data of its parent.
in FormConfigInterface at line line 76
bool
getCompound()
Returns whether the form is compound.
This property is independent of whether the form actually has children. A form can be compound and have no children at all, like for example an empty collection form.
in FormConfigInterface at line line 83
ResolvedFormTypeInterface
getType()
Returns the form types used to construct the form.
in FormConfigInterface at line line 90
DataTransformerInterface[]
getViewTransformers()
Returns the view transformers of the form.
in FormConfigInterface at line line 97
DataTransformerInterface[]
getModelTransformers()
Returns the model transformers of the form.
in FormConfigInterface at line line 104
DataMapperInterface
getDataMapper()
Returns the data mapper of the form.
in FormConfigInterface at line line 111
bool
getRequired()
Returns whether the form is required.
in FormConfigInterface at line line 118
bool
getDisabled()
Returns whether the form is disabled.
in FormConfigInterface at line line 125
bool
getErrorBubbling()
Returns whether errors attached to the form will bubble to its parent.
in FormConfigInterface at line line 132
mixed
getEmptyData()
Returns the data that should be returned when the form is empty.
in FormConfigInterface at line line 139
array
getAttributes()
Returns additional attributes of the form.
in FormConfigInterface at line line 148
bool
hasAttribute(string $name)
Returns whether the attribute with the given name exists.
in FormConfigInterface at line line 158
mixed
getAttribute(string $name, mixed $default = null)
Returns the value of the given attribute.
in FormConfigInterface at line line 165
mixed
getData()
Returns the initial data of the form.
in FormConfigInterface at line line 172
string
getDataClass()
Returns the class of the form data or null if the data is scalar or an array.
in FormConfigInterface at line line 183
bool
getDataLocked()
Returns whether the form's data is locked.
A form with locked data is restricted to the data passed in this configuration. The data can only be modified then by submitting the form.
in FormConfigInterface at line line 190
FormFactoryInterface
getFormFactory()
Returns the form factory used for creating new forms.
in FormConfigInterface at line line 197
string
getAction()
Returns the target URL of the form.
in FormConfigInterface at line line 204
string
getMethod()
Returns the HTTP method used by the form.
in FormConfigInterface at line line 211
RequestHandlerInterface
getRequestHandler()
Returns the request handler used by the form.
in FormConfigInterface at line line 219
bool
getAutoInitialize()
Returns whether the form should be initialized upon creation.
in FormConfigInterface at line line 226
array
getOptions()
Returns all options passed during the construction of the form.
in FormConfigInterface at line line 235
bool
hasOption(string $name)
Returns whether a specific option exists.
in FormConfigInterface at line line 245
mixed
getOption(string $name, mixed $default = null)
Returns the value of a specific option.
at line line 33
FormConfigBuilderInterface
addEventListener(string $eventName, callable $listener, int $priority)
Adds an event listener to an event on this form.
at line line 42
FormConfigBuilderInterface
addEventSubscriber(EventSubscriberInterface $subscriber)
Adds an event subscriber for events on this form.
at line line 57
FormConfigBuilderInterface
addViewTransformer(DataTransformerInterface $viewTransformer, bool $forcePrepend = false)
Appends / prepends a transformer to the view transformer chain.
The transform method of the transformer is used to convert data from the normalized to the view format. The reverseTransform method of the transformer is used to convert from the view to the normalized format.
at line line 64
FormConfigBuilderInterface
resetViewTransformers()
Clears the view transformers.
at line line 79
FormConfigBuilderInterface
addModelTransformer(DataTransformerInterface $modelTransformer, bool $forceAppend = false)
Prepends / appends a transformer to the normalization transformer chain.
The transform method of the transformer is used to convert data from the model to the normalized format. The reverseTransform method of the transformer is used to convert from the normalized to the model format.
at line line 86
FormConfigBuilderInterface
resetModelTransformers()
Clears the normalization transformers.
at line line 96
FormConfigBuilderInterface
setAttribute(string $name, mixed $value)
Sets the value for an attribute.
at line line 105
FormConfigBuilderInterface
setAttributes(array $attributes)
Sets the attributes.
at line line 114
FormConfigBuilderInterface
setDataMapper(DataMapperInterface $dataMapper = null)
Sets the data mapper used by the form.
at line line 123
FormConfigBuilderInterface
setDisabled(bool $disabled)
Set whether the form is disabled.
at line line 132
FormConfigBuilderInterface
setEmptyData(mixed $emptyData)
Sets the data used for the client data when no value is submitted.
at line line 141
FormConfigBuilderInterface
setErrorBubbling(bool $errorBubbling)
Sets whether errors bubble up to the parent.
at line line 150
FormConfigBuilderInterface
setRequired(bool $required)
Sets whether this field is required to be filled out when submitted.
at line line 161
FormConfigBuilderInterface
setPropertyPath(null|string|PropertyPathInterface $propertyPath)
Sets the property path that the form should be mapped to.
at line line 171
FormConfigBuilderInterface
setMapped(bool $mapped)
Sets whether the form should be mapped to an element of its parent's data.
at line line 181
FormConfigBuilderInterface
setByReference(bool $byReference)
Sets whether the form's data should be modified by reference.
at line line 190
FormConfigBuilderInterface
setInheritData(bool $inheritData)
Sets whether the form should read and write the data of its parent.
at line line 201
FormConfigBuilderInterface
setCompound(bool $compound)
Sets whether the form should be compound.
at line line 210
FormConfigBuilderInterface
setType(ResolvedFormTypeInterface $type)
Set the types.
at line line 219
FormConfigBuilderInterface
setData(mixed $data)
Sets the initial data of the form.
at line line 232
FormConfigBuilderInterface
setDataLocked(bool $locked)
Locks the form's data to the data passed in the configuration.
A form with locked data is restricted to the data passed in this configuration. The data can only be modified then by submitting the form.
at line line 239
setFormFactory(FormFactoryInterface $formFactory)
Sets the form factory used for creating new forms.
at line line 248
FormConfigBuilderInterface
setAction(string $action)
Sets the target URL of the form.
at line line 257
FormConfigBuilderInterface
setMethod(string $method)
Sets the HTTP method used by the form.
at line line 266
FormConfigBuilderInterface
setRequestHandler(RequestHandlerInterface $requestHandler)
Sets the request handler used by the form.
at line line 280
FormConfigBuilderInterface
setAutoInitialize(bool $initialize)
Sets whether the form should be initialized automatically.
Should be set to true only for root forms.
at line line 287
FormConfigInterface
getFormConfig()
Builds and returns the form configuration.