]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/form/Symfony/Component/Form/FormConfigInterface.php
4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Form
;
15 * The configuration of a {@link Form} object.
17 * @author Bernhard Schussek <bschussek@gmail.com>
19 interface FormConfigInterface
22 * Returns the event dispatcher used to dispatch form events.
24 * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface The dispatcher.
26 public function getEventDispatcher();
29 * Returns the name of the form used as HTTP parameter.
31 * @return string The form name.
33 public function getName();
36 * Returns the property path that the form should be mapped to.
38 * @return null|\Symfony\Component\PropertyAccess\PropertyPathInterface The property path.
40 public function getPropertyPath();
43 * Returns whether the form should be mapped to an element of its
46 * @return Boolean Whether the form is mapped.
48 public function getMapped();
51 * Returns whether the form's data should be modified by reference.
53 * @return Boolean Whether to modify the form's data by reference.
55 public function getByReference();
58 * Returns whether the form should read and write the data of its parent.
60 * @return Boolean Whether the form should inherit its parent's data.
62 public function getInheritData();
65 * Returns whether the form is compound.
67 * This property is independent of whether the form actually has
68 * children. A form can be compound and have no children at all, like
69 * for example an empty collection form.
71 * @return Boolean Whether the form is compound.
73 public function getCompound();
76 * Returns the form types used to construct the form.
78 * @return ResolvedFormTypeInterface The form's type.
80 public function getType();
83 * Returns the view transformers of the form.
85 * @return DataTransformerInterface[] An array of {@link DataTransformerInterface} instances.
87 public function getViewTransformers();
90 * Returns the model transformers of the form.
92 * @return DataTransformerInterface[] An array of {@link DataTransformerInterface} instances.
94 public function getModelTransformers();
97 * Returns the data mapper of the form.
99 * @return DataMapperInterface The data mapper.
101 public function getDataMapper();
104 * Returns whether the form is required.
106 * @return Boolean Whether the form is required.
108 public function getRequired();
111 * Returns whether the form is disabled.
113 * @return Boolean Whether the form is disabled.
115 public function getDisabled();
118 * Returns whether errors attached to the form will bubble to its parent.
120 * @return Boolean Whether errors will bubble up.
122 public function getErrorBubbling();
125 * Returns the data that should be returned when the form is empty.
127 * @return mixed The data returned if the form is empty.
129 public function getEmptyData();
132 * Returns additional attributes of the form.
134 * @return array An array of key-value combinations.
136 public function getAttributes();
139 * Returns whether the attribute with the given name exists.
141 * @param string $name The attribute name.
143 * @return Boolean Whether the attribute exists.
145 public function hasAttribute($name);
148 * Returns the value of the given attribute.
150 * @param string $name The attribute name.
151 * @param mixed $default The value returned if the attribute does not exist.
153 * @return mixed The attribute value.
155 public function getAttribute($name, $default = null);
158 * Returns the initial data of the form.
160 * @return mixed The initial form data.
162 public function getData();
165 * Returns the class of the form data or null if the data is scalar or an array.
167 * @return string The data class or null.
169 public function getDataClass();
172 * Returns whether the form's data is locked.
174 * A form with locked data is restricted to the data passed in
175 * this configuration. The data can only be modified then by
176 * submitting the form.
178 * @return Boolean Whether the data is locked.
180 public function getDataLocked();
183 * Returns the form factory used for creating new forms.
185 * @return FormFactoryInterface The form factory.
187 public function getFormFactory();
190 * Returns the target URL of the form.
192 * @return string The target URL of the form.
194 public function getAction();
197 * Returns the HTTP method used by the form.
199 * @return string The HTTP method of the form.
201 public function getMethod();
204 * Returns the request handler used by the form.
206 * @return RequestHandlerInterface The request handler.
208 public function getRequestHandler();
211 * Returns whether the form should be initialized upon creation.
213 * @return Boolean Returns true if the form should be initialized
214 * when created, false otherwise.
216 public function getAutoInitialize();
219 * Returns all options passed during the construction of the form.
221 * @return array The passed options.
223 public function getOptions();
226 * Returns whether a specific option exists.
228 * @param string $name The option name,
230 * @return Boolean Whether the option exists.
232 public function hasOption($name);
235 * Returns the value of a specific option.
237 * @param string $name The option name.
238 * @param mixed $default The value returned if the option does not exist.
240 * @return mixed The option value.
242 public function getOption($name, $default = null);