src/Helper/ValidationHelper.php
public function validate()
    {
        $valid = true;
        foreach ($this->object->validationRules() as $rule) {
            if (isset($rule[0], $rule[1])) {
                $properties = $rule[0];
                $validator = 'validate' . $rule[1];
                if (!method_exists($this, $validator)) {
                    throw new NostoException(sprintf(
                        'Nosto validator "%s" does not exist.',
                        $validator
                    ));
                }
                $params = array_merge(array($properties), array_slice($rule, 2));
                $isValid = call_user_func_array(array($this, $validator), $params);
                if (!$isValid) {
                    $valid = false;
                }
            }
        }

        return $valid;
    }
public function validate()
    {
        $valid = true;
        foreach ($this->object->validationRules() as $rule) {
            if (isset($rule[0], $rule[1])) {
                $properties = $rule[0];
                $validator = 'validate' . $rule[1];
                if (!method_exists($this, $validator)) {
                    throw new NostoException(sprintf(
                        'Nosto validator "%s" does not exist.',
                        $validator
                    ));
                }
                $params = array_merge(array($properties), array_slice($rule, 2));
                $isValid = call_user_func_array(array($this, $validator), $params);
                if (!$isValid) {
                    $valid = false;
                }
            }
        }

        return $valid;
    }
public function validate ( ) { $ valid = true ; foreach ( $ this -> object -> validationRules ( ) as $ rule ) { if ( isset ( $ rule [ 0 ] , $ rule [ 1 ] ) ) { $ properties = $ rule [ 0 ] ; $ validator = 'validate' . $ rule [ 1 ] ; if ( ! method_exists ( $ this , $ validator ) ) { throw new NostoException ( sprintf ( 'Nosto validator "%s" does not exist.' , $ validator ) ) ; } $ params = array_merge ( array ( $ properties ) , array_slice ( $ rule , 2 ) ) ; $ isValid = call_user_func_array ( array ( $ this , $ validator ) , $ params ) ; if ( ! $ isValid ) { $ valid = false ; } } } return $ valid ; }
Validates the `validatable` object based on it's validation rules.

@return bool true if the object is valid, false otherwise.
@throws NostoException if the rule validator is not found.
Validates the validatable object based on it s validation rules .