interface FormInterface implements Iterator, FormInterface
Methods
FormInterface | setParent(FormInterface $parent = null) Sets the parent form. | from FormInterface |
FormInterface|null | getParent() Returns the parent form. | from FormInterface |
FormInterface | add(FormInterface|string|int $child, string|null $type = null, array $options = array()) Adds or replaces a child to the form. | from FormInterface |
FormInterface | get(string $name) Returns the child with the given name. | from FormInterface |
bool | has(string $name) Returns whether a child with the given name exists. | from FormInterface |
FormInterface | remove(string $name) Removes a child from the form. | from FormInterface |
FormInterface[] | all() Returns all children in this group. | from FormInterface |
FormErrorIterator | getErrors(bool $deep = false, bool $flatten = true) Returns the errors of this form. | from FormInterface |
FormInterface | setData(mixed $modelData) Updates the form with default data. | from FormInterface |
mixed | getData() Returns the data in the format needed for the underlying object. | from FormInterface |
mixed | getNormData() Returns the normalized data of the field. | from FormInterface |
mixed | getViewData() Returns the data transformed by the value transformer. | from FormInterface |
array | getExtraData() Returns the extra data. | from FormInterface |
FormConfigInterface | getConfig() Returns the form's configuration. | from FormInterface |
bool | isSubmitted() Returns whether the form is submitted. | from FormInterface |
string | getName() Returns the name by which the form is identified in forms. | from FormInterface |
PropertyPathInterface | getPropertyPath() Returns the property path that the form is mapped to. | from FormInterface |
FormInterface | addError(FormError $error) Adds an error to this form. | from FormInterface |
bool | isValid() Returns whether the form and all children are valid. | from FormInterface |
bool | isRequired() Returns whether the form is required to be filled out. | from FormInterface |
bool | isDisabled() Returns whether this form is disabled. | from FormInterface |
bool | isEmpty() Returns whether the form is empty. | from FormInterface |
bool | isSynchronized() Returns whether the data in the different formats is synchronized. | from FormInterface |
TransformationFailedException|null | getTransformationFailure() Returns the data transformation failure, if any. | from FormInterface |
FormInterface | initialize() Initializes the form tree. | from FormInterface |
FormInterface | handleRequest(mixed $request = null) Inspects the given request and calls {@link submit()} if the form was submitted. | from FormInterface |
FormInterface | submit(null|string|array $submittedData, bool $clearMissing = true) Submits data to the form, transforms and validates it. | from FormInterface |
FormInterface | getRoot() Returns the root of the form tree. | from FormInterface |
bool | isRoot() Returns whether the field is the root of the form tree. | from FormInterface |
FormView | createView(FormView $parent = null) Creates a view. | from FormInterface |
Details
FormInterface setParent(FormInterface $parent = null)
Sets the parent form.
FormInterface|null getParent()
Returns the parent form.
FormInterface add(FormInterface|string|int $child, string|null $type = null, array $options = array())
Adds or replaces a child to the form.
FormInterface get(string $name)
Returns the child with the given name.
bool has(string $name)
Returns whether a child with the given name exists.
FormInterface remove(string $name)
Removes a child from the form.
FormInterface[] all()
Returns all children in this group.
FormErrorIterator getErrors(bool $deep = false, bool $flatten = true)
Returns the errors of this form.
FormInterface setData(mixed $modelData)
Updates the form with default data.
mixed getData()
Returns the data in the format needed for the underlying object.
mixed getNormData()
Returns the normalized data of the field.
mixed getViewData()
Returns the data transformed by the value transformer.
array getExtraData()
Returns the extra data.
FormConfigInterface getConfig()
Returns the form's configuration.
bool isSubmitted()
Returns whether the form is submitted.
string getName()
Returns the name by which the form is identified in forms.
PropertyPathInterface getPropertyPath()
Returns the property path that the form is mapped to.
FormInterface addError(FormError $error)
Adds an error to this form.
bool isValid()
Returns whether the form and all children are valid.
If the form is not submitted, this method always returns false.
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.
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.
bool isEmpty()
Returns whether the form is empty.
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()}.
TransformationFailedException|null getTransformationFailure()
Returns the data transformation failure, if any.
FormInterface initialize()
Initializes the form tree.
Should be called on the root form after constructing the tree.
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.
FormInterface submit(null|string|array $submittedData, bool $clearMissing = true)
Submits data to the form, transforms and validates it.
FormInterface getRoot()
Returns the root of the form tree.
bool isRoot()
Returns whether the field is the root of the form tree.
Please login to continue.