Ejemplo n.º 1
0
 function validate($value)
 {
     if (($error = parent::validate($value)) !== true) {
         return $error;
     }
     if (!ctype_digit($value)) {
         return 'ERR_NON_INTEGER';
     }
     if ($this->min !== NULL && $value < $this->min) {
         return 'ERR_UNDER_MIN';
     }
     if ($this->max !== NULL && $value > $this->max) {
         return 'ERR_OVER_MAX';
     }
     return true;
 }