1 | <?php |
||
40 | abstract class SizeValidator |
||
41 | { |
||
42 | |||
43 | use AllowEmpty, |
||
44 | Messages; |
||
45 | |||
46 | /** |
||
47 | * @var integer maximum length. Defaults to null, meaning no maximum limit. |
||
48 | */ |
||
49 | public $max; |
||
50 | |||
51 | /** |
||
52 | * @var integer minimum length. Defaults to null, meaning no minimum limit. |
||
53 | */ |
||
54 | public $min; |
||
55 | |||
56 | /** |
||
57 | * @var integer exact length. Defaults to null, meaning no exact length limit. |
||
58 | */ |
||
59 | public $is; |
||
60 | |||
61 | /** |
||
62 | * @var string user-defined error message used when the value is too short. |
||
63 | * @deprecated use `msgTooShort` instead |
||
64 | */ |
||
65 | public $tooShort; |
||
66 | |||
67 | /** |
||
68 | * @var string user-defined error message used when the value is too long. |
||
69 | * @deprecated use `msgTooLong` instead |
||
70 | */ |
||
71 | public $tooLong; |
||
72 | |||
73 | /** |
||
74 | * @Label('{attribute} is invalid') |
||
75 | * @var string |
||
76 | */ |
||
77 | public $msgInvalid = ''; |
||
78 | |||
79 | /** |
||
80 | * @Label('{attribute} is too small') |
||
81 | * @var string |
||
82 | */ |
||
83 | public $msgTooShort = ''; |
||
84 | |||
85 | /** |
||
86 | * @Label('{attribute} is too large') |
||
87 | * @var string |
||
88 | */ |
||
89 | public $msgTooLong = ''; |
||
90 | |||
91 | /** |
||
92 | * @Label('{attribute} is of the wrong size') |
||
93 | * @var string |
||
94 | */ |
||
95 | public $msgLength = ''; |
||
96 | |||
97 | 13 | protected function isValidValueOf($model, $attribute, $value, $label = '') |
|
140 | |||
141 | } |
||
142 |