public function validate(array $values, array $rules)
    {
        // Assume no validation and result success
        $result = true;

        if (true !== $valid = $this->validateByRules($rules, $values)) {
            foreach ($valid as $componentName => $error) {
                $this->setError($error, $componentName);
            }

            // Set general form error
            $this->setError(
                [
                    'error' => 'general',
                    'info'  => [],
                ],
                Doozr_Form_Service_Constant::ERROR_IDENTIFIER_FORM
            );

            $result = false;
        }

        return $result;
    }
public function validate(array $values, array $rules)
    {
        // Assume no validation and result success
        $result = true;

        if (true !== $valid = $this->validateByRules($rules, $values)) {
            foreach ($valid as $componentName => $error) {
                $this->setError($error, $componentName);
            }

            // Set general form error
            $this->setError(
                [
                    'error' => 'general',
                    'info'  => [],
                ],
                Doozr_Form_Service_Constant::ERROR_IDENTIFIER_FORM
            );

            $result = false;
        }

        return $result;
    }
public function validate ( array $ values , array $ rules ) { // Assume no validation and result success $ result = true ; if ( true !== $ valid = $ this -> validateByRules ( $ rules , $ values ) ) { foreach ( $ valid as $ componentName => $ error ) { $ this -> setError ( $ error , $ componentName ) ; } // Set general form error $ this -> setError ( [ 'error' => 'general' , 'info' => [ ] , ] , Doozr_Form_Service_Constant :: ERROR_IDENTIFIER_FORM ) ; $ result = false ; } return $ result ; }
Validates values by validation rules.

@param array $values Values to be validated
@param array $rules  Rules to be applied on values

@author Benjamin Carl <opensource@clickalicious.de>

@return bool TRUE if form valid, otherwise FALSE
Validates values by validation rules .