Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/lib/zend/Zend/Service/DeveloperGarden/Response/ResponseAbstract.php
Go to the documentation of this file.
00001 <?php
00026 require_once 'Zend/Service/DeveloperGarden/Response/Exception.php';
00027 
00036 abstract class Zend_Service_DeveloperGarden_Response_ResponseAbstract
00037 {
00043     public $errorCode = null;
00044 
00050     public $errorMessage = null;
00051 
00058     public function parse()
00059     {
00060         if ($this->hasError()) {
00061             throw new Zend_Service_DeveloperGarden_Response_Exception(
00062                 $this->getErrorMessage(),
00063                 $this->getErrorCode()
00064             );
00065         }
00066 
00067         return $this;
00068     }
00069 
00075     public function getErrorCode()
00076     {
00077         return $this->errorCode;
00078     }
00079 
00085     public function getErrorMessage()
00086     {
00087         return $this->errorMessage;
00088     }
00089 
00095     public function isValid()
00096     {
00097         return ($this->errorCode === null
00098              || $this->errorCode == '0000');
00099     }
00100 
00106     public function hasError()
00107     {
00108         return ($this->errorCode !== null
00109                 && $this->errorCode != '0000');
00110     }
00111 }
 All Data Structures Namespaces Files Functions Variables Enumerations