diff -r 000000000000 -r 4eba9c11703f web/Zend/Service/DeveloperGarden/Response/ResponseAbstract.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/Service/DeveloperGarden/Response/ResponseAbstract.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,111 @@ +hasError()) { + throw new Zend_Service_DeveloperGarden_Response_Exception( + $this->getErrorMessage(), + $this->getErrorCode() + ); + } + + return $this; + } + + /** + * returns the error code + * + * @return string|null + */ + public function getErrorCode() + { + return $this->errorCode; + } + + /** + * returns the error message + * + * @return string + */ + public function getErrorMessage() + { + return $this->errorMessage; + } + + /** + * returns true if the errorCode is not null and not 0000 + * + * @return boolean + */ + public function isValid() + { + return ($this->errorCode === null + || $this->errorCode == '0000'); + } + + /** + * returns true if we have a error situation + * + * @return boolean + */ + public function hasError() + { + return ($this->errorCode !== null + && $this->errorCode != '0000'); + } +}