platform/api/symfony/Component/Form/FormInterface.yaml
2024-09-02 10:44:11 -07:00

417 lines
9.8 KiB
YAML

name: FormInterface
class_comment: null
dependencies:
- name: PropertyPathInterface
type: class
source: Symfony\Component\PropertyAccess\PropertyPathInterface
properties: []
methods:
- name: setParent
visibility: public
parameters:
- name: parent
comment: '# * A form group bundling multiple forms in a hierarchical structure.
# *
# * @author Bernhard Schussek <bschussek@gmail.com>
# *
# * @extends \ArrayAccess<string, FormInterface>
# * @extends \Traversable<string, FormInterface>
# */
# interface FormInterface extends \ArrayAccess, \Traversable, \Countable
# {
# /**
# * Sets the parent form.
# *
# * @param FormInterface|null $parent The parent form or null if it''s the root
# *
# * @return $this
# *
# * @throws Exception\AlreadySubmittedException if the form has already been submitted
# * @throws Exception\LogicException when trying to set a parent for
a form with
# * an empty name'
- name: getParent
visibility: public
parameters: []
comment: '# * Returns the parent form.'
- name: add
visibility: public
parameters:
- name: child
- name: type
default: 'null'
- name: options
default: '[]'
comment: '# * Adds or replaces a child to the form.
# *
# * @param FormInterface|string $child The FormInterface instance or the name
of the child
# * @param string|null $type The child''s type, if a name was passed
# * @param array $options The child''s options, if a name was passed
# *
# * @return $this
# *
# * @throws Exception\AlreadySubmittedException if the form has already been submitted
# * @throws Exception\LogicException when trying to add a child to
a non-compound form
# * @throws Exception\UnexpectedTypeException if $child or $type has an unexpected
type'
- name: get
visibility: public
parameters:
- name: name
comment: '# * Returns the child with the given name.
# *
# * @throws Exception\OutOfBoundsException if the named child does not exist'
- name: has
visibility: public
parameters:
- name: name
comment: '# * Returns whether a child with the given name exists.'
- name: remove
visibility: public
parameters:
- name: name
comment: '# * Removes a child from the form.
# *
# * @return $this
# *
# * @throws Exception\AlreadySubmittedException if the form has already been submitted'
- name: all
visibility: public
parameters: []
comment: '# * Returns all children in this group.
# *
# * @return self[]'
- name: getErrors
visibility: public
parameters:
- name: deep
default: 'false'
- name: flatten
default: 'true'
comment: '# * Returns the errors of this form.
# *
# * @param bool $deep Whether to include errors of child forms as well
# * @param bool $flatten Whether to flatten the list of errors in case
# * $deep is set to true'
- name: setData
visibility: public
parameters:
- name: modelData
comment: '# * Updates the form with default model data.
# *
# * @param mixed $modelData The data formatted as expected for the underlying
object
# *
# * @return $this
# *
# * @throws Exception\AlreadySubmittedException If the form has already been
submitted
# * @throws Exception\LogicException if the view data does not
match the expected type
# * according to {@link FormConfigInterface::getDataClass}
# * @throws Exception\RuntimeException If listeners try to call setData
in a cycle or if
# * the form inherits data from
its parent
# * @throws Exception\TransformationFailedException if the synchronization failed'
- name: getData
visibility: public
parameters: []
comment: '# * Returns the model data in the format needed for the underlying object.
# *
# * @return mixed When the field is not submitted, the default data is returned.
# * When the field is submitted, the default data has been bound
# * to the submitted view data.
# *
# * @throws Exception\RuntimeException If the form inherits data but has no parent'
- name: getNormData
visibility: public
parameters: []
comment: '# * Returns the normalized data of the field, used as internal bridge
# * between model data and view data.
# *
# * @return mixed When the field is not submitted, the default data is returned.
# * When the field is submitted, the normalized submitted data
# * is returned if the field is synchronized with the view data,
# * null otherwise.
# *
# * @throws Exception\RuntimeException If the form inherits data but has no parent'
- name: getViewData
visibility: public
parameters: []
comment: '# * Returns the view data of the field.
# *
# * It may be defined by {@link FormConfigInterface::getDataClass}.
# *
# * There are two cases:
# *
# * - When the form is compound the view data is mapped to the children.
# * Each child will use its mapped data as model data.
# * It can be an array, an object or null.
# *
# * - When the form is simple its view data is used to be bound
# * to the submitted data.
# * It can be a string or an array.
# *
# * In both cases the view data is the actual altered data on submission.
# *
# * @throws Exception\RuntimeException If the form inherits data but has no parent'
- name: getExtraData
visibility: public
parameters: []
comment: '# * Returns the extra submitted data.
# *
# * @return array The submitted data which do not belong to a child'
- name: getConfig
visibility: public
parameters: []
comment: '# * Returns the form''s configuration.'
- name: isSubmitted
visibility: public
parameters: []
comment: '# * Returns whether the form is submitted.'
- name: getName
visibility: public
parameters: []
comment: '# * Returns the name by which the form is identified in forms.
# *
# * Only root forms are allowed to have an empty name.'
- name: getPropertyPath
visibility: public
parameters: []
comment: '# * Returns the property path that the form is mapped to.'
- name: addError
visibility: public
parameters:
- name: error
comment: '# * Adds an error to this form.
# *
# * @return $this'
- name: isValid
visibility: public
parameters: []
comment: '# * Returns whether the form and all children are valid.
# *
# * @throws Exception\LogicException if the form is not submitted'
- name: isRequired
visibility: public
parameters: []
comment: '# * 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.'
- name: isDisabled
visibility: public
parameters: []
comment: '# * 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.'
- name: isEmpty
visibility: public
parameters: []
comment: '# * Returns whether the form is empty.'
- name: isSynchronized
visibility: public
parameters: []
comment: '# * 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()}.
# *
# * If the form is not submitted, this method always returns true.'
- name: getTransformationFailure
visibility: public
parameters: []
comment: '# * Returns the data transformation failure, if any, during submission.'
- name: initialize
visibility: public
parameters: []
comment: '# * Initializes the form tree.
# *
# * Should be called on the root form after constructing the tree.
# *
# * @return $this
# *
# * @throws Exception\RuntimeException If the form is not the root'
- name: handleRequest
visibility: public
parameters:
- name: request
default: 'null'
comment: '# * 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.
# *
# * @return $this'
- name: submit
visibility: public
parameters:
- name: submittedData
- name: clearMissing
default: 'true'
comment: '# * Submits data to the form.
# *
# * @param string|array|null $submittedData The submitted data
# * @param bool $clearMissing Whether to set fields to NULL
# * when they are missing in the
# * submitted data. This argument
# * is only used in compound form
# *
# * @return $this
# *
# * @throws Exception\AlreadySubmittedException if the form has already been submitted'
- name: getRoot
visibility: public
parameters: []
comment: '# * Returns the root of the form tree.'
- name: isRoot
visibility: public
parameters: []
comment: '# * Returns whether the field is the root of the form tree.'
- name: createView
visibility: public
parameters:
- name: parent
default: 'null'
comment: null
traits:
- Symfony\Component\PropertyAccess\PropertyPathInterface
interfaces: []