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() |
||
93 | |||
94 | /** |
||
95 | * @return string |
||
96 | */ |
||
97 | public function getFormClose() |
||
101 | |||
102 | /** |
||
103 | * @param string $prefix |
||
104 | * @param string $suffix |
||
105 | * @codeCoverageIgnore |
||
106 | */ |
||
107 | public function setFormErrorContainer(string $prefix, string $suffix) |
||
112 | |||
113 | /** |
||
114 | * @param string $prefix |
||
115 | * @param string $suffix |
||
116 | * @codeCoverageIgnore |
||
117 | */ |
||
118 | public function setFormErrorItemContainer(string $prefix, string $suffix) |
||
123 | |||
124 | /** |
||
125 | * @return array |
||
126 | * @codeCoverageIgnore |
||
127 | */ |
||
128 | public function getData() |
||
152 | |||
153 | /** |
||
154 | * @param array $data |
||
155 | * @codeCoverageIgnore |
||
156 | */ |
||
157 | public function setData(array $data) |
||
169 | |||
170 | /** |
||
171 | * @return bool |
||
172 | * @codeCoverageIgnore |
||
173 | */ |
||
174 | public function isValid() :bool |
||
191 | |||
192 | /** |
||
193 | * @param array $definition |
||
194 | * @throws InvalidArgumentException |
||
195 | * @codeCoverageIgnore |
||
196 | */ |
||
197 | protected function add(array $definition) |
||
243 | |||
244 | /** |
||
245 | * @param AbstractType $typeClass |
||
246 | * @param array $definition |
||
247 | * @throws FormInvalidException |
||
248 | * @return boolean |
||
249 | * @codeCoverageIgnore |
||
250 | */ |
||
251 | private function addValidators(AbstractType &$typeClass, array $definition) |
||
281 | |||
282 | /** |
||
283 | * @return mixed |
||
284 | */ |
||
285 | abstract protected function create(); |
||
286 | |||
287 | } |