ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
XML_RPC2_Backend_Php_Value_Boolean Class Reference
+ Inheritance diagram for XML_RPC2_Backend_Php_Value_Boolean:
+ Collaboration diagram for XML_RPC2_Backend_Php_Value_Boolean:

Public Member Functions

 __construct ($nativeValue)
 Constructor. More...
 
 encode ()
 Encode the instance into XML, for transport. More...
 
- Public Member Functions inherited from XML_RPC2_Backend_Php_Value_Scalar
 getScalarType ()
 scalarType property getter More...
 
 __construct ($scalarType, $nativeValue)
 Constructor. More...
 
 encode ()
 Encode the instance into XML, for transport. More...
 
- Public Member Functions inherited from XML_RPC2_Backend_Php_Value
 getNativeValue ()
 nativeValue property getter More...
 

Static Public Member Functions

static decode ($xml)
 decode. More...
 
- Static Public Member Functions inherited from XML_RPC2_Backend_Php_Value_Scalar
static createFromNative ($nativeValue, $explicitType=null)
 Choose a XML_RPC2_Value subclass appropriate for the given value and create it. More...
 
- Static Public Member Functions inherited from XML_RPC2_Backend_Php_Value
static createFromNative ($nativeValue, $explicitType=null)
 Choose a XML_RPC2_Value subclass appropriate for the given value and create it. More...
 
static createFromDecode ($simpleXML)
 Decode an encoded value and build the applicable XML_RPC2_Value subclass. More...
 
- Static Public Member Functions inherited from XML_RPC2_Value
static createFromNative ($value, $explicitType=null)
 Factory method that constructs the appropriate XML-RPC encoded type value. More...
 

Additional Inherited Members

- Protected Member Functions inherited from XML_RPC2_Backend_Php_Value_Scalar
 setScalarType ($value)
 scalarType property setter More...
 
- Protected Member Functions inherited from XML_RPC2_Backend_Php_Value
 setNativeValue ($value)
 nativeValue setter More...
 

Detailed Description

Definition at line 57 of file Boolean.php.

Constructor & Destructor Documentation

◆ __construct()

XML_RPC2_Backend_Php_Value_Boolean::__construct (   $nativeValue)

Constructor.

Will build a new XML_RPC2_Value_Boolean with the given value

Parameters
mixedvalue

Definition at line 67 of file Boolean.php.

68  {
69  parent::__construct('boolean', $nativeValue);
70  }

Member Function Documentation

◆ decode()

static XML_RPC2_Backend_Php_Value_Boolean::decode (   $xml)
static

decode.

Decode transport XML and set the instance value accordingly

Parameters
mixedThe encoded XML-RPC value,

Definition at line 93 of file Boolean.php.

94  {
95  // TODO Remove reparsing of XML fragment, when SimpleXML proves more solid. Currently it segfaults when
96  // xpath is used both in an element and in one of its children
97  $xml = simplexml_load_string($xml->asXML());
98  $value = $xml->xpath('/value/boolean/text()');
99 
100  // Double cast explanation: http://pear.php.net/bugs/bug.php?id=8644
101  return (boolean) ((string) $value[0]);
102  }

◆ encode()

XML_RPC2_Backend_Php_Value_Boolean::encode ( )

Encode the instance into XML, for transport.

Returns
string The encoded XML-RPC value,

Definition at line 80 of file Boolean.php.

References XML_RPC2_Backend_Php_Value\getNativeValue().

81  {
82  return '<boolean>' . ($this->getNativeValue() ? 1 : 0). '</boolean>';
83  }
getNativeValue()
nativeValue property getter
Definition: Value.php:76
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: