public function addError(Error $error, $prepend = false)
    {
        if ($prepend === true) {
            array_unshift($this->errors, $error);
        }
        else {
            $this->errors[] = $error;
        }
        return count($this->errors);
    }
public function addError(Error $error, $prepend = false)
    {
        if ($prepend === true) {
            array_unshift($this->errors, $error);
        }
        else {
            $this->errors[] = $error;
        }
        return count($this->errors);
    }
public function addError ( Error $ error , $ prepend = false ) { if ( $ prepend === true ) { array_unshift ( $ this -> errors , $ error ) ; } else { $ this -> errors [ ] = $ error ; } return count ( $ this -> errors ) ; }
Add a validation error

@param \sndsgd\field\Error $error
@param boolean $prepend Add the error to the beginning
@return integer The total number of validation errors
Add a validation error