public function addErrors(array $errors)
    {
        foreach ($errors as $error) {
            if (!$error instanceof ValidationError)
                throw new Exception('Error was not instance of ValidationError: '.$error);
            if (!in_array($error, $this->errors))
                $this->errors[] = $error;
        }

        return $this;
    }
public function addErrors(array $errors)
    {
        foreach ($errors as $error) {
            if (!$error instanceof ValidationError)
                throw new Exception('Error was not instance of ValidationError: '.$error);
            if (!in_array($error, $this->errors))
                $this->errors[] = $error;
        }

        return $this;
    }
public function addErrors ( array $ errors ) { foreach ( $ errors as $ error ) { if ( ! $ error instanceof ValidationError ) throw new Exception ( 'Error was not instance of ValidationError: ' . $ error ) ; if ( ! in_array ( $ error , $ this -> errors ) ) $ this -> errors [ ] = $ error ; } return $ this ; }
Adds more than one error to the collection of errors

@param array $errors Each object in the array must be of type ValidationError

@return this
Adds more than one error to the collection of errors