public function runValidators($value)
    {
        if (empty($value)) {
            return;
        }

        // collect all validation errors for this field
        $validationErrors = [];
        foreach ($this->getFieldValidators() as $validator) {
            try {
                $validator($value);
            } catch (ValidationError $error) {
                $validationErrors = array_merge($validationErrors, $error->getErrorList());
            }
        }

        if (!empty($validationErrors)) {
            throw new ValidationError($validationErrors);
        }
    }
public function runValidators($value)
    {
        if (empty($value)) {
            return;
        }

        // collect all validation errors for this field
        $validationErrors = [];
        foreach ($this->getFieldValidators() as $validator) {
            try {
                $validator($value);
            } catch (ValidationError $error) {
                $validationErrors = array_merge($validationErrors, $error->getErrorList());
            }
        }

        if (!empty($validationErrors)) {
            throw new ValidationError($validationErrors);
        }
    }
public function runValidators ( $ value ) { if ( empty ( $ value ) ) { return ; } // collect all validation errors for this field $ validationErrors = [ ] ; foreach ( $ this -> getFieldValidators ( ) as $ validator ) { try { $ validator ( $ value ) ; } catch ( ValidationError $ error ) { $ validationErrors = array_merge ( $ validationErrors , $ error -> getErrorList ( ) ) ; } } if ( ! empty ( $ validationErrors ) ) { throw new ValidationError ( $ validationErrors ) ; } }
Passes the value through all the validators for this field.

@param $value

@throws ValidationError
@author: Eddilbert Macharia (http://eddmash.com)<edd.cowan@gmail.com>
Passes the value through all the validators for this field .