1 | <?php |
||
11 | abstract class BaseInput implements FormElementInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private $name; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private $options; |
||
22 | |||
23 | /** |
||
24 | * @var string|int |
||
25 | */ |
||
26 | private $value; |
||
27 | |||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $type; |
||
32 | |||
33 | /** |
||
34 | * @var string[]|array |
||
35 | */ |
||
36 | private $errors; |
||
37 | |||
38 | /** |
||
39 | * @param string $name |
||
40 | * @param string $type |
||
41 | * @param array $options |
||
42 | */ |
||
43 | public function __construct($name, $type, array $options = []) |
||
54 | |||
55 | /** |
||
56 | * @inheritDoc |
||
57 | */ |
||
58 | public function getType() |
||
62 | |||
63 | /** |
||
64 | * @inheritDoc |
||
65 | */ |
||
66 | public function getOptions() |
||
70 | |||
71 | /** |
||
72 | * @inheritDoc |
||
73 | */ |
||
74 | public function getName() |
||
78 | |||
79 | /** |
||
80 | * @inheritdoc |
||
81 | */ |
||
82 | public function getId() |
||
86 | |||
87 | /** |
||
88 | * @inheritDoc |
||
89 | */ |
||
90 | public function getValue() |
||
94 | |||
95 | /** |
||
96 | * @inheritDoc |
||
97 | */ |
||
98 | public function setValue($value) |
||
102 | |||
103 | /** |
||
104 | * @param string $name |
||
105 | * @param int|string $value |
||
106 | * |
||
107 | * @return $this |
||
108 | */ |
||
109 | protected function setAttribute($name, $value) |
||
115 | |||
116 | /** |
||
117 | * @return $this |
||
118 | */ |
||
119 | public function required() |
||
125 | |||
126 | /** |
||
127 | * @return $this |
||
128 | */ |
||
129 | public function disable() |
||
134 | |||
135 | /** |
||
136 | * @inheritdoc |
||
137 | */ |
||
138 | public function isDisabled() |
||
142 | |||
143 | /** |
||
144 | * @param string $option |
||
145 | * |
||
146 | * @return string|int|boolean|null |
||
147 | */ |
||
148 | public function getOption($option) |
||
156 | |||
157 | /** |
||
158 | * @inheritDoc |
||
159 | */ |
||
160 | public function setErrors($errors = []) |
||
164 | |||
165 | /** |
||
166 | * @inheritDoc |
||
167 | */ |
||
168 | public function hasError() |
||
172 | |||
173 | } |