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(){ |
||
85 | |||
86 | /** |
||
87 | * @inheritDoc |
||
88 | */ |
||
89 | public function getValue() |
||
93 | |||
94 | /** |
||
95 | * @inheritDoc |
||
96 | */ |
||
97 | public function setValue($value) |
||
101 | |||
102 | /** |
||
103 | * @param string $name |
||
104 | * @param int|string $value |
||
105 | * |
||
106 | * @return $this |
||
107 | */ |
||
108 | protected function setAttribute($name, $value) |
||
114 | |||
115 | /** |
||
116 | * @return $this |
||
117 | */ |
||
118 | public function required(){ |
||
123 | |||
124 | /** |
||
125 | * @return $this |
||
126 | */ |
||
127 | public function disable(){ |
||
131 | |||
132 | /** |
||
133 | * @inheritdoc |
||
134 | */ |
||
135 | public function isDisabled(){ |
||
138 | |||
139 | /** |
||
140 | * @param string $option |
||
141 | * |
||
142 | * @return string|int|boolean|null |
||
143 | */ |
||
144 | public function getOption($option){ |
||
151 | |||
152 | /** |
||
153 | * @inheritDoc |
||
154 | */ |
||
155 | public function setErrors($errors = []) |
||
159 | |||
160 | /** |
||
161 | * @inheritDoc |
||
162 | */ |
||
163 | public function hasError() |
||
167 | |||
168 | } |