|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00026 require_once 'Zend/Service/DeveloperGarden/Response/ResponseAbstract.php'; 00027 00036 abstract class Zend_Service_DeveloperGarden_Response_SendSms_SendSmsAbstract 00037 extends Zend_Service_DeveloperGarden_Response_ResponseAbstract 00038 { 00044 public $return = null; 00045 00052 public function parse() 00053 { 00054 if ($this->hasError()) { 00055 require_once 'Zend/Service/DeveloperGarden/Response/Exception.php'; 00056 throw new Zend_Service_DeveloperGarden_Response_Exception( 00057 $this->getErrorMessage(), 00058 $this->getErrorCode() 00059 ); 00060 } 00061 00062 return $this; 00063 } 00064 00070 public function getErrorCode() 00071 { 00072 $retValue = null; 00073 if ($this->return instanceof stdClass) { 00074 $retValue = $this->return->status; 00075 } 00076 return $retValue; 00077 } 00078 00084 public function getErrorMessage() 00085 { 00086 $retValue = null; 00087 if ($this->return instanceof stdClass) { 00088 $retValue = $this->return->description; 00089 } 00090 return $retValue; 00091 } 00092 00098 public function isValid() 00099 { 00100 return ($this->return === null 00101 || $this->return->status == '0000'); 00102 } 00103 00109 public function hasError() 00110 { 00111 $retValue = false; 00112 if ($this->return instanceof stdClass 00113 && $this->return->status != '0000' 00114 ) { 00115 $retValue = true; 00116 } 00117 return $retValue; 00118 } 00119 }