Beispiel #1
0
 protected function validate(Validator $v)
 {
     $v->whenSet(function (Validator $v) {
         $v->notObject('The value needs to be an object');
     });
     return parent::validate($v);
 }
Beispiel #2
0
 protected function validate(Validator $v)
 {
     $v->whenSet(function (Validator $v) {
         $v->notIn([true, false, 0, 1, '0', '1', 'yes', 'true', 'on', 'no', 'false', 'off'], 'The value needs to be one of 0/1/yes/true/on/no/false/off');
     });
     return parent::validate($v);
 }
Beispiel #3
0
 protected function validate(Validator $v)
 {
     $v->whenSet(function (Validator $v) {
         $v->notFloat('Value has to be a floating number');
     });
     return parent::validate($v);
 }
Beispiel #4
0
 protected function validate(Validator $v)
 {
     $v->whenSet(function (Validator $v) {
         $v->notArray('The value needs to be an array');
     });
     return parent::validate($v);
 }
 protected function validate(Validator $v)
 {
     $v->whenSet(function (Validator $v) {
         $v->notDateTime('The value is not a valid Date and Time string');
     });
     return parent::validate($v);
 }
Beispiel #6
0
 protected function validate(Validator $v)
 {
     $v->whenSet(function (Validator $v) {
         $v->smallerThan(1, 1, 'The value needs to be exatly one character long');
     });
     return parent::validate($v);
 }
Beispiel #7
0
 public function validates()
 {
     $v = $this->_type->getValidator();
     $this->validate($v);
     return $v->hasErrors();
 }