1 | <?php |
||
22 | abstract class AbstractFormBuilder |
||
23 | { |
||
24 | |||
25 | /** @var array */ |
||
26 | protected $formAttributes = []; |
||
27 | |||
28 | /** @var AbstractType[] */ |
||
29 | protected $fields = []; |
||
30 | |||
31 | /** @var Entity */ |
||
32 | protected $entity = null; |
||
33 | |||
34 | /** @var string */ |
||
35 | protected $formErrorContainerPrefix = ''; |
||
36 | |||
37 | /** @var string */ |
||
38 | protected $formErrorContainerSuffix = ''; |
||
39 | |||
40 | /** @var string */ |
||
41 | protected $formErrorItemContainerPrefix = ''; |
||
42 | |||
43 | /** @var string */ |
||
44 | protected $formErrorItemContainerSuffix = ''; |
||
45 | |||
46 | /** @var */ |
||
47 | private $confirmValue = null; |
||
48 | |||
49 | /** |
||
50 | * AbstractFormBuilder constructor |
||
51 | * @param Entity $entity |
||
52 | * @codeCoverageIgnore |
||
53 | */ |
||
54 | public function __construct(Entity $entity = null) |
||
63 | |||
64 | /** |
||
65 | * @param string $name |
||
66 | * @return AbstractType |
||
67 | * @throws InvalidFormElementException |
||
68 | * @codeCoverageIgnore |
||
69 | */ |
||
70 | public function getField(string $name) |
||
77 | |||
78 | /** |
||
79 | * @param array $attributes |
||
80 | */ |
||
81 | public function setFormAttributes(array $attributes) |
||
85 | |||
86 | /** |
||
87 | * @return string |
||
88 | */ |
||
89 | public function getFormOpen() |
||
97 | |||
98 | /** |
||
99 | * @return string |
||
100 | */ |
||
101 | public function getFormClose() |
||
105 | |||
106 | /** |
||
107 | * @param string $prefix |
||
108 | * @param string $suffix |
||
109 | * @codeCoverageIgnore |
||
110 | */ |
||
111 | public function setFormErrorContainer(string $prefix, string $suffix) |
||
116 | |||
117 | /** |
||
118 | * @param string $prefix |
||
119 | * @param string $suffix |
||
120 | * @codeCoverageIgnore |
||
121 | */ |
||
122 | public function setFormErrorItemContainer(string $prefix, string $suffix) |
||
127 | |||
128 | /** |
||
129 | * @return array |
||
130 | * @codeCoverageIgnore |
||
131 | */ |
||
132 | public function getData() |
||
156 | |||
157 | /** |
||
158 | * @param array $data |
||
159 | * @codeCoverageIgnore |
||
160 | */ |
||
161 | public function setData(array $data) |
||
173 | |||
174 | /** |
||
175 | * @return bool |
||
176 | * @codeCoverageIgnore |
||
177 | */ |
||
178 | public function isValid() :bool |
||
195 | |||
196 | /** |
||
197 | * @param array $definition |
||
198 | * @throws InvalidArgumentException |
||
199 | * @codeCoverageIgnore |
||
200 | */ |
||
201 | protected function add(array $definition) |
||
247 | |||
248 | /** |
||
249 | * @param AbstractType $typeClass |
||
250 | * @param array $definition |
||
251 | * @throws FormInvalidException |
||
252 | * @return boolean |
||
253 | * @codeCoverageIgnore |
||
254 | */ |
||
255 | private function addValidators(AbstractType &$typeClass, array $definition) |
||
285 | |||
286 | /** |
||
287 | * @return mixed |
||
288 | */ |
||
289 | abstract protected function create(); |
||
290 | |||
291 | } |