[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/includes/domit/ -> dom_xmlrpc_methodresponse_fault.php (source)

   1  <?php
   2  /**
   3  * dom_xmlrpc_methodresponse_fault encapsulates an XML-RPC fault
   4  * @package dom-xmlrpc
   5  * @copyright (C) 2004 John Heinstein. All rights reserved
   6  * @license http://www.gnu.org/copyleft/lesser.html LGPL License
   7  * @author John Heinstein <johnkarl@nbnet.nb.ca>
   8  * @link http://www.engageinteractive.com/dom_xmlrpc/ DOM XML-RPC Home Page
   9  * DOM XML-RPC is Free Software
  10  **/
  11  
  12  if (!defined('DOM_XMLRPC_INCLUDE_PATH')) {
  13      define('DOM_XMLRPC_INCLUDE_PATH', (dirname(__FILE__) . "/"));
  14  }
  15  
  16  require_once (DOM_XMLRPC_INCLUDE_PATH . 'dom_xmlrpc_builder.php');
  17  
  18  /**
  19  * Encapsulates an XML-RPC fault
  20  *
  21  * @package dom-xmlrpc
  22  * @author John Heinstein <johnkarl@nbnet.nb.ca>
  23  */
  24  class dom_xmlrpc_methodresponse_fault extends dom_xmlrpc_builder {
  25      /** @var int The fault code */
  26      var $faultCode;
  27      /** @var string A string description of the fault code */
  28      var $faultString;
  29  
  30      /**
  31      * Constructor: instantiates the fault object
  32      * @param object A reference to the fault code
  33      */
  34  	function dom_xmlrpc_methodresponse_fault($fault = null) {
  35          require_once (DOM_XMLRPC_INCLUDE_PATH . 'dom_xmlrpc_constants.php');
  36          require_once (DOM_XMLRPC_INCLUDE_PATH . 'dom_xmlrpc_utilities.php');
  37  
  38          $this->methodType = DOM_XMLRPC_TYPE_METHODRESPONSE;
  39  
  40          if ($fault != null) {
  41              $this->setFaultCode($fault->getFaultCode());
  42              $this->setFaultString($fault->getFaultString());
  43          }
  44      } //dom_xmlrpc_methodresponse_fault
  45  
  46      /**
  47      * Returns the fault code
  48      * @return int The fault code
  49      */
  50  	function getFaultCode() {
  51          return $this->faultCode;
  52      } //getFaultCode
  53  
  54      /**
  55      * Sets the fault code
  56      * @param int The fault code
  57      */
  58  	function setFaultCode($faultCode) {
  59          $this->faultCode = $faultCode;
  60      } //setFaultCode
  61  
  62      /**
  63      * Returns the fault string
  64      * @return int The fault string
  65      */
  66  	function getFaultString() {
  67          return $this->faultString;
  68      } //getFaultString
  69  
  70      /**
  71      * Sets the fault string
  72      * @param string The fault string
  73      */
  74  	function setFaultString($faultString) {
  75          $this->faultString = $faultString;
  76      } //setFaultString
  77  
  78      /**
  79      * Returns a string representation of the fault
  80      * @return string A string representation of the fault
  81      */
  82  	function toString() {
  83           $data = <<<METHODRESPONSE_FAULT
  84  <?xml version='1.0'?>
  85  <methodResponse>
  86      <fault>
  87          <value>
  88              <struct>
  89                  <member>
  90                      <name>faultCode</name>
  91                      <value><int>$this->faultCode</int></value>
  92                  </member>
  93                  <member>
  94                      <name>faultString</name>
  95                      <value><string>$this->faultString</string></value>
  96                  </member>
  97              </struct>
  98          </value>
  99      </fault>
 100  </methodResponse>
 101  METHODRESPONSE_FAULT;
 102  
 103          return $data;
 104      } //toString
 105  
 106      /**
 107      * Alias of toString
 108      * @return string A string representation of the fault
 109      */
 110  	function toXML() {
 111          return $this->toString();
 112      } //toXML
 113  } //dom_xmlrpc_methodresponse_fault
 114  
 115  ?>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics