1 | <?php |
||
26 | abstract class AbstractFormBuilder |
||
27 | { |
||
28 | |||
29 | /** @var string */ |
||
30 | protected $identifier = ''; |
||
31 | |||
32 | /** @var array */ |
||
33 | protected $formAttributes = []; |
||
34 | |||
35 | /** @var AbstractType[] */ |
||
36 | protected $fields = []; |
||
37 | |||
38 | /** @var Entity */ |
||
39 | protected $entity = null; |
||
40 | |||
41 | /** @var string */ |
||
42 | protected $formErrorContainerPrefix = ''; |
||
43 | |||
44 | /** @var string */ |
||
45 | protected $formErrorContainerSuffix = ''; |
||
46 | |||
47 | /** @var string */ |
||
48 | protected $formErrorItemContainerPrefix = ''; |
||
49 | |||
50 | /** @var string */ |
||
51 | protected $formErrorItemContainerSuffix = ''; |
||
52 | |||
53 | /** @var */ |
||
54 | private $confirmValue = null; |
||
55 | |||
56 | /** |
||
57 | * AbstractFormBuilder constructor |
||
58 | * @param Entity $entity |
||
59 | * @codeCoverageIgnore |
||
60 | */ |
||
61 | public function __construct(Entity $entity = null) |
||
70 | |||
71 | /** |
||
72 | * @param string $name |
||
73 | * @return AbstractType |
||
74 | * @throws InvalidFormElementException |
||
75 | * @codeCoverageIgnore |
||
76 | */ |
||
77 | public function getField(string $name) |
||
84 | |||
85 | /** |
||
86 | * @return string |
||
87 | */ |
||
88 | public function getIdentifier() |
||
92 | |||
93 | /** |
||
94 | * @param array $attributes |
||
95 | */ |
||
96 | public function setFormAttributes(array $attributes) |
||
100 | |||
101 | /** |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getFormOpen() |
||
113 | |||
114 | /** |
||
115 | * @return string |
||
116 | */ |
||
117 | public function getFormClose() |
||
121 | |||
122 | /** |
||
123 | * @param string $prefix |
||
124 | * @param string $suffix |
||
125 | * @codeCoverageIgnore |
||
126 | */ |
||
127 | public function setFormErrorContainer(string $prefix, string $suffix) |
||
132 | |||
133 | /** |
||
134 | * @param string $prefix |
||
135 | * @param string $suffix |
||
136 | * @codeCoverageIgnore |
||
137 | */ |
||
138 | public function setFormErrorItemContainer(string $prefix, string $suffix) |
||
143 | |||
144 | /** |
||
145 | * @return array |
||
146 | * @codeCoverageIgnore |
||
147 | */ |
||
148 | public function getData() |
||
172 | |||
173 | /** |
||
174 | * @param array $data |
||
175 | * @codeCoverageIgnore |
||
176 | */ |
||
177 | public function setData(array $data) |
||
189 | |||
190 | /** |
||
191 | * @return bool |
||
192 | * @codeCoverageIgnore |
||
193 | */ |
||
194 | public function isValid() :bool |
||
211 | |||
212 | /** |
||
213 | * @param array $definition |
||
214 | * @throws InvalidArgumentException |
||
215 | * @codeCoverageIgnore |
||
216 | */ |
||
217 | protected function add(array $definition) |
||
263 | |||
264 | /** |
||
265 | * @param AbstractType $typeClass |
||
266 | * @param array $definition |
||
267 | * @throws FormInvalidException |
||
268 | * @return boolean |
||
269 | * @codeCoverageIgnore |
||
270 | */ |
||
271 | private function addValidators(AbstractType &$typeClass, array $definition) |
||
305 | |||
306 | /** |
||
307 | * @return mixed |
||
308 | */ |
||
309 | abstract protected function create(); |
||
310 | |||
311 | } |