1 | <?php |
||
14 | abstract class Form implements FormInterface |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $name; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | private $method; |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $options; |
||
31 | |||
32 | /** |
||
33 | * @var \stdClass|null |
||
34 | */ |
||
35 | private $object; |
||
36 | |||
37 | /** |
||
38 | * @var null|\ValidatorInterface |
||
39 | */ |
||
40 | private $validator; |
||
41 | |||
42 | /** |
||
43 | * @var array|FormElementInterface[] |
||
44 | */ |
||
45 | private $elements; |
||
46 | |||
47 | /** |
||
48 | * Form constructor. |
||
49 | * |
||
50 | * @param string $name |
||
51 | * @param string $method |
||
52 | * @param array $options |
||
53 | */ |
||
54 | public function __construct($name, $method = FormInterface::METHOD_GET, array $options = []) |
||
61 | |||
62 | /** |
||
63 | * @inheritDoc |
||
64 | */ |
||
65 | public function getName() |
||
69 | |||
70 | /** |
||
71 | * @inheritDoc |
||
72 | */ |
||
73 | public function getMethod() |
||
77 | |||
78 | /** |
||
79 | * @inheritDoc |
||
80 | */ |
||
81 | public function getOptions(){ |
||
84 | |||
85 | /** |
||
86 | * @inheritDoc |
||
87 | */ |
||
88 | public function add(FormElementInterface $element) |
||
95 | |||
96 | /** |
||
97 | * @inheritDoc |
||
98 | */ |
||
99 | public function validate() |
||
111 | |||
112 | /** |
||
113 | * @param null|\ValidatorInterface $validator |
||
114 | * |
||
115 | * @return Form |
||
116 | */ |
||
117 | protected function setValidator(ValidatorInterface $validator) |
||
122 | |||
123 | |||
124 | /** |
||
125 | * @inheritDoc |
||
126 | */ |
||
127 | public function bind($object) |
||
143 | |||
144 | /** |
||
145 | * @inheritDoc |
||
146 | */ |
||
147 | public function setData(array $data) |
||
166 | |||
167 | /** |
||
168 | * @inheritDoc |
||
169 | */ |
||
170 | public function getObject() |
||
174 | |||
175 | /** |
||
176 | * @inheritDoc |
||
177 | */ |
||
178 | public function getElement($elementName) |
||
186 | |||
187 | /** |
||
188 | * @param string $name |
||
189 | * |
||
190 | * @return string |
||
191 | */ |
||
192 | private function camelCase($name) |
||
197 | |||
198 | } |