]> git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/form/Symfony/Component/Form/FormBuilderInterface.php
twig implementation
[github/wallabag/wallabag.git] / vendor / symfony / form / Symfony / Component / Form / FormBuilderInterface.php
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12 namespace Symfony\Component\Form;
13
14 /**
15 * @author Bernhard Schussek <bschussek@gmail.com>
16 */
17 interface FormBuilderInterface extends \Traversable, \Countable, FormConfigBuilderInterface
18 {
19 /**
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.
22 *
23 * If you add a nested group, this group should also be represented in the
24 * object hierarchy.
25 *
26 * @param string|integer|FormBuilderInterface $child
27 * @param string|FormTypeInterface $type
28 * @param array $options
29 *
30 * @return FormBuilderInterface The builder object.
31 */
32 public function add($child, $type = null, array $options = array());
33
34 /**
35 * Creates a form builder.
36 *
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
40 *
41 * @return FormBuilderInterface The created builder.
42 */
43 public function create($name, $type = null, array $options = array());
44
45 /**
46 * Returns a child by name.
47 *
48 * @param string $name The name of the child
49 *
50 * @return FormBuilderInterface The builder for the child
51 *
52 * @throws Exception\InvalidArgumentException if the given child does not exist
53 */
54 public function get($name);
55
56 /**
57 * Removes the field with the given name.
58 *
59 * @param string $name
60 *
61 * @return FormBuilderInterface The builder object.
62 */
63 public function remove($name);
64
65 /**
66 * Returns whether a field with the given name exists.
67 *
68 * @param string $name
69 *
70 * @return Boolean
71 */
72 public function has($name);
73
74 /**
75 * Returns the children.
76 *
77 * @return array
78 */
79 public function all();
80
81 /**
82 * Creates the form.
83 *
84 * @return Form The form
85 */
86 public function getForm();
87 }