1 | <?php |
||
18 | class MinMaxValidator extends ArrayValidator |
||
19 | { |
||
20 | /** |
||
21 | * @inheritdoc |
||
22 | */ |
||
23 | public function validateAttribute($model, $attribute) |
||
33 | |||
34 | /** |
||
35 | * @inheritdoc |
||
36 | */ |
||
37 | protected function validateValue($value) |
||
38 | { |
||
39 | if ($value instanceof QueryInterface) { |
||
40 | return $this->validateQueryValue($value); |
||
41 | } |
||
42 | |||
43 | return parent::validateValue($value); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param QueryInterface $query |
||
48 | * @return array|null the error message and the parameters to be inserted into the error message. |
||
49 | * Null should be returned if the data is valid. |
||
50 | */ |
||
51 | protected function validateQueryValue(QueryInterface $query) |
||
68 | |||
69 | /** |
||
70 | * @param $model |
||
71 | * @param $attribute |
||
72 | * @param QueryInterface $query |
||
73 | */ |
||
74 | protected function validateQueryAttribute($model, $attribute, QueryInterface $query) |
||
88 | } |
||
89 |