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 * @author Bernhard Schussek <bschussek@gmail.com>
17 interface FormBuilderInterface
extends \Traversable
, \Countable
, FormConfigBuilderInterface
20 * Adds a new field to this group. A field must have a unique name within
21 * the group. Otherwise the existing field is overwritten.
23 * If you add a nested group, this group should also be represented in the
26 * @param string|integer|FormBuilderInterface $child
27 * @param string|FormTypeInterface $type
28 * @param array $options
30 * @return FormBuilderInterface The builder object.
32 public function add($child, $type = null, array $options = array());
35 * Creates a form builder.
37 * @param string $name The name of the form or the name of the property
38 * @param string|FormTypeInterface $type The type of the form or null if name is a property
39 * @param array $options The options
41 * @return FormBuilderInterface The created builder.
43 public function create($name, $type = null, array $options = array());
46 * Returns a child by name.
48 * @param string $name The name of the child
50 * @return FormBuilderInterface The builder for the child
52 * @throws Exception\InvalidArgumentException if the given child does not exist
54 public function get($name);
57 * Removes the field with the given name.
61 * @return FormBuilderInterface The builder object.
63 public function remove($name);
66 * Returns whether a field with the given name exists.
72 public function has($name);
75 * Returns the children.
79 public function all();
84 * @return Form The form
86 public function getForm();