/
AbstractType.php
119 lines (106 loc) · 2.87 KB
/
AbstractType.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Form;
use Symfony\Component\Form\Exception\UnexpectedTypeException;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class AbstractType implements FormTypeInterface
{
/**
* @var array
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
private $extensions = array();
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
}
/**
* {@inheritdoc}
*/
public function buildView(FormView $view, FormInterface $form, array $options)
{
}
/**
* {@inheritdoc}
*/
public function finishView(FormView $view, FormInterface $form, array $options)
{
}
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults($this->getDefaultOptions());
$resolver->addAllowedValues($this->getAllowedOptionValues());
}
/**
* Returns the default options for this type.
*
* @return array The default options
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
* Use {@link setDefaultOptions()} instead.
*/
public function getDefaultOptions()
{
return array();
}
/**
* Returns the allowed option values for each option (if any).
*
* @return array The allowed option values
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
* Use {@link setDefaultOptions()} instead.
*/
public function getAllowedOptionValues()
{
return array();
}
/**
* {@inheritdoc}
*/
public function getParent()
{
return 'form';
}
/**
* Sets the extensions for this type.
*
* @param array $extensions An array of FormTypeExtensionInterface
*
* @throws Exception\UnexpectedTypeException if any extension does not implement FormTypeExtensionInterface
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3.
*/
public function setExtensions(array $extensions)
{
$this->extensions = $extensions;
}
/**
* Returns the extensions associated with this type.
*
* @return array An array of FormTypeExtensionInterface
*
* @deprecated Deprecated since version 2.1, to be removed in 2.3. Use
* {@link ResolvedFormTypeInterface::getTypeExtensions()} instead.
*/
public function getExtensions()
{
return $this->extensions;
}
}