ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
XML_RPC2_Backend_Php_Value_Array Class Reference
+ Inheritance diagram for XML_RPC2_Backend_Php_Value_Array:
+ Collaboration diagram for XML_RPC2_Backend_Php_Value_Array:

Public Member Functions

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

Static Public Member Functions

static decode ($xml)
 Decode transport XML and set the instance value accordingly.
- 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.
static createFromDecode ($simpleXML)
 Decode an encoded value and build the applicable XML_RPC2_Value subclass.

Protected Member Functions

 setNativeValue ($value)
 nativeValue property setter

Detailed Description

Definition at line 53 of file Array.php.

Constructor & Destructor Documentation

XML_RPC2_Backend_Php_Value_Array::__construct (   $nativeValue)

Constructor.

Will build a new XML_RPC2_Backend_Php_Value_Array with the given nativeValue

Parameters
mixednativeValue

Definition at line 79 of file Array.php.

References setNativeValue().

{
$this->setNativeValue($nativeValue);
}

+ Here is the call graph for this function:

Member Function Documentation

static XML_RPC2_Backend_Php_Value_Array::decode (   $xml)
static

Decode transport XML and set the instance value accordingly.

Parameters
mixedThe encoded XML-RPC value,

Definition at line 114 of file Array.php.

References $result, and XML_RPC2_Backend_Php_Value\createFromDecode().

{
// 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());
$values = $xml->xpath('/value/array/data/value');
$result = array();
foreach (array_keys($values) as $i) {
$result[] = XML_RPC2_Backend_Php_Value::createFromDecode($values[$i])->getNativeValue();
}
return $result;
}

+ Here is the call graph for this function:

XML_RPC2_Backend_Php_Value_Array::encode ( )

Encode the instance into XML, for transport.

Returns
string The encoded XML-RPC value,

Definition at line 92 of file Array.php.

References $result, XML_RPC2_Backend_Php_Value\createFromNative(), and XML_RPC2_Backend_Php_Value\getNativeValue().

{
$result = '<array><data>';
foreach($this->getNativeValue() as $element) {
$result .= '<value>';
$result .= ($element instanceof XML_RPC2_Backend_Php_Value) ?
$element->encode() :
$result .= '</value>';
}
$result .= '</data></array>';
return $result;
}

+ Here is the call graph for this function:

XML_RPC2_Backend_Php_Value_Array::setNativeValue (   $value)
protected

nativeValue property setter

Parameters
mixedvalue the new nativeValue

Reimplemented from XML_RPC2_Backend_Php_Value.

Definition at line 63 of file Array.php.

Referenced by __construct().

{
if (!is_array($value)) {
throw new XML_RPC2_InvalidTypeException(sprintf('Cannot create XML_RPC2_Value_Array from type \'%s\'.', gettype($nativeValue)));
}
}

+ Here is the caller graph for this function:


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