]> git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/form/Symfony/Component/Form/FormFactoryInterface.php
gitignore vendor
[github/wallabag/wallabag.git] / vendor / symfony / form / Symfony / Component / Form / FormFactoryInterface.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 FormFactoryInterface
18 {
19 /**
20 * Returns a form.
21 *
22 * @see createBuilder()
23 *
24 * @param string|FormTypeInterface $type The type of the form
25 * @param mixed $data The initial data
26 * @param array $options The options
27 *
28 * @return FormInterface The form named after the type
29 *
30 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
31 */
32 public function create($type = 'form', $data = null, array $options = array());
33
34 /**
35 * Returns a form.
36 *
37 * @see createNamedBuilder()
38 *
39 * @param string|integer $name The name of the form
40 * @param string|FormTypeInterface $type The type of the form
41 * @param mixed $data The initial data
42 * @param array $options The options
43 *
44 * @return FormInterface The form
45 *
46 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
47 */
48 public function createNamed($name, $type = 'form', $data = null, array $options = array());
49
50 /**
51 * Returns a form for a property of a class.
52 *
53 * @see createBuilderForProperty()
54 *
55 * @param string $class The fully qualified class name
56 * @param string $property The name of the property to guess for
57 * @param mixed $data The initial data
58 * @param array $options The options for the builder
59 *
60 * @return FormInterface The form named after the property
61 *
62 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the form type
63 */
64 public function createForProperty($class, $property, $data = null, array $options = array());
65
66 /**
67 * Returns a form builder.
68 *
69 * @param string|FormTypeInterface $type The type of the form
70 * @param mixed $data The initial data
71 * @param array $options The options
72 *
73 * @return FormBuilderInterface The form builder
74 *
75 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
76 */
77 public function createBuilder($type = 'form', $data = null, array $options = array());
78
79 /**
80 * Returns a form builder.
81 *
82 * @param string|integer $name The name of the form
83 * @param string|FormTypeInterface $type The type of the form
84 * @param mixed $data The initial data
85 * @param array $options The options
86 *
87 * @return FormBuilderInterface The form builder
88 *
89 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
90 */
91 public function createNamedBuilder($name, $type = 'form', $data = null, array $options = array());
92
93 /**
94 * Returns a form builder for a property of a class.
95 *
96 * If any of the 'max_length', 'required' and type options can be guessed,
97 * and are not provided in the options argument, the guessed value is used.
98 *
99 * @param string $class The fully qualified class name
100 * @param string $property The name of the property to guess for
101 * @param mixed $data The initial data
102 * @param array $options The options for the builder
103 *
104 * @return FormBuilderInterface The form builder named after the property
105 *
106 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the form type
107 */
108 public function createBuilderForProperty($class, $property, $data = null, array $options = array());
109 }