FormInterface
interface FormInterface implements Iterator, FormInterface
Methods
Adds or replaces a child to the form.
Returns the errors of this form.
Returns the property path that the form is mapped to.
Returns whether the data in the different formats is synchronized.
Returns the data transformation failure, if any.
Inspects the given request and calls {@link submit()} if the form was submitted.
Submits data to the form, transforms and validates it.
Details
in FormInterface at line line 34
FormInterface
setParent(FormInterface $parent = null)
Sets the parent form.
in FormInterface at line line 41
FormInterface|null
getParent()
Returns the parent form.
in FormInterface at line line 56
FormInterface
add(FormInterface|string|int $child, string|null $type = null, array $options = array())
Adds or replaces a child to the form.
in FormInterface at line line 67
FormInterface
get(string $name)
Returns the child with the given name.
in FormInterface at line line 76
bool
has(string $name)
Returns whether a child with the given name exists.
in FormInterface at line line 87
FormInterface
remove(string $name)
Removes a child from the form.
in FormInterface at line line 94
FormInterface[]
all()
Returns all children in this group.
in FormInterface at line line 109
FormErrorIterator
getErrors(bool $deep = false, bool $flatten = true)
Returns the errors of this form.
in FormInterface at line line 123
FormInterface
setData(mixed $modelData)
Updates the form with default data.
in FormInterface at line line 130
mixed
getData()
Returns the data in the format needed for the underlying object.
in FormInterface at line line 139
mixed
getNormData()
Returns the normalized data of the field.
in FormInterface at line line 146
mixed
getViewData()
Returns the data transformed by the value transformer.
in FormInterface at line line 153
array
getExtraData()
Returns the extra data.
in FormInterface at line line 160
FormConfigInterface
getConfig()
Returns the form's configuration.
in FormInterface at line line 167
bool
isSubmitted()
Returns whether the form is submitted.
in FormInterface at line line 174
string
getName()
Returns the name by which the form is identified in forms.
in FormInterface at line line 181
PropertyPathInterface
getPropertyPath()
Returns the property path that the form is mapped to.
in FormInterface at line line 190
FormInterface
addError(FormError $error)
Adds an error to this form.
in FormInterface at line line 199
bool
isValid()
Returns whether the form and all children are valid.
If the form is not submitted, this method always returns false.
in FormInterface at line line 210
bool
isRequired()
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.
in FormInterface at line line 223
bool
isDisabled()
Returns whether this form is disabled.
The content of a disabled form is displayed, but not allowed to be modified. The validation of modified disabled forms should fail.
Forms whose parents are disabled are considered disabled regardless of their own state.
in FormInterface at line line 230
bool
isEmpty()
Returns whether the form is empty.
in FormInterface at line line 240
bool
isSynchronized()
Returns whether the data in the different formats is synchronized.
If the data is not synchronized, you can get the transformation failure by calling {@link getTransformationFailure()}.
in FormInterface at line line 247
TransformationFailedException|null
getTransformationFailure()
Returns the data transformation failure, if any.
in FormInterface at line line 256
FormInterface
initialize()
Initializes the form tree.
Should be called on the root form after constructing the tree.
in FormInterface at line line 270
FormInterface
handleRequest(mixed $request = null)
Inspects the given request and calls {@link submit()} if the form was submitted.
Internally, the request is forwarded to the configured {@link RequestHandlerInterface} instance, which determines whether to submit the form or not.
in FormInterface at line line 284
FormInterface
submit(null|string|array $submittedData, bool $clearMissing = true)
Submits data to the form, transforms and validates it.
in FormInterface at line line 291
FormInterface
getRoot()
Returns the root of the form tree.
in FormInterface at line line 298
bool
isRoot()
Returns whether the field is the root of the form tree.
in FormInterface at line line 307
FormView
createView(FormView $parent = null)
Creates a view.