return; } /** * parse the response data and throws exceptions * * @throws Zend_Service_DeveloperGarden_Response_Exception * @return Zend_Service_DeveloperGarden_Response_ResponseAbstract */ public function parse() { if ($this->hasError()) { throw new Zend_Service_DeveloperGarden_Response_Exception( $this->getErrorMessage(), $this->getErrorCode() ); } return $this; } /** * returns the error code * * @return string|null */ public function getErrorCode() { $retValue = null; if ($this->return instanceof stdClass) { $retValue = $this->return->status; } return $retValue; } /** * returns the error message * * @return string */ public function getErrorMessage() { $retValue = null; if ($this->return instanceof stdClass) { $retValue = $this->return->err_msg; } return $retValue; } /** * returns true if the errorCode is not null and not 0000 * * @return boolean */ public function isValid() { return ($this->return === null || $this->return->status == '0000'); } /** * returns true if we have a error situation * * @return boolean */ public function hasError() { $retValue = false; if ($this->return instanceof stdClass && $this->return->status != '0000' ) { $retValue = true; } return $retValue; } }