1 | <?php |
||
5 | class RadioValidator extends FieldValidator |
||
6 | { |
||
7 | |||
8 | private $value; |
||
9 | |||
10 | const ANY = null; |
||
11 | |||
12 | /** |
||
13 | * @param string $errorMsg The message to show if the field does not pass validation |
||
14 | * @param string $value The value to allow |
||
15 | */ |
||
16 | public function __construct ($errorMsg, $value = self::ANY) |
||
21 | |||
22 | public function getJsonData () |
||
29 | |||
30 | public function isValid ($value) |
||
34 | |||
35 | public function describeObject () |
||
39 | |||
40 | /** |
||
41 | * Whether the validator returns true as long as any value is checked |
||
42 | * @return bool |
||
43 | */ |
||
44 | private function allowAny () |
||
48 | |||
49 | } |
||
50 |