ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups 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.
 encode ()
 Encode the instance into XML, for transport.
- Public Member Functions inherited from XML_RPC2_Backend_Php_Value_Scalar
 getScalarType ()
 scalarType property getter
 __construct ($scalarType, $nativeValue)
 Constructor.
- Public Member Functions inherited from XML_RPC2_Backend_Php_Value
 getNativeValue ()
 nativeValue property getter

Static Public Member Functions

static decode ($xml)
 decode.
- 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.
- Static Public Member Functions inherited from XML_RPC2_Backend_Php_Value
static createFromDecode ($simpleXML)
 Decode an encoded value and build the applicable XML_RPC2_Value subclass.

Additional Inherited Members

- Protected Member Functions inherited from XML_RPC2_Backend_Php_Value_Scalar
 setScalarType ($value)
 scalarType property setter

Detailed Description

Definition at line 57 of file Boolean.php.

Constructor & Destructor Documentation

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.

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

Member Function Documentation

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.

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

Encode the instance into XML, for transport.

Returns
string The encoded XML-RPC value,

Reimplemented from XML_RPC2_Backend_Php_Value_Scalar.

Definition at line 80 of file Boolean.php.

References XML_RPC2_Backend_Php_Value\getNativeValue().

{
return '<boolean>' . ($this->getNativeValue() ? 1 : 0). '</boolean>';
}

+ Here is the call graph for this function:


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