]>
git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/form/Symfony/Component/Form/FormFactoryInterface.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 * @author Bernhard Schussek <bschussek@gmail.com>
17 interface FormFactoryInterface
22 * @see createBuilder()
24 * @param string|FormTypeInterface $type The type of the form
25 * @param mixed $data The initial data
26 * @param array $options The options
28 * @return FormInterface The form named after the type
30 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
32 public function create($type = 'form', $data = null, array $options = array());
37 * @see createNamedBuilder()
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
44 * @return FormInterface The form
46 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
48 public function createNamed($name, $type = 'form', $data = null, array $options = array());
51 * Returns a form for a property of a class.
53 * @see createBuilderForProperty()
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
60 * @return FormInterface The form named after the property
62 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the form type
64 public function createForProperty($class, $property, $data = null, array $options = array());
67 * Returns a form builder.
69 * @param string|FormTypeInterface $type The type of the form
70 * @param mixed $data The initial data
71 * @param array $options The options
73 * @return FormBuilderInterface The form builder
75 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
77 public function createBuilder($type = 'form', $data = null, array $options = array());
80 * Returns a form builder.
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
87 * @return FormBuilderInterface The form builder
89 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the given type
91 public function createNamedBuilder($name, $type = 'form', $data = null, array $options = array());
94 * Returns a form builder for a property of a class.
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.
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
104 * @return FormBuilderInterface The form builder named after the property
106 * @throws \Symfony\Component\OptionsResolver\Exception\InvalidOptionsException if any given option is not applicable to the form type
108 public function createBuilderForProperty($class, $property, $data = null, array $options = array());