Represent a native XML-RPC value entity, used as parameters for the methods called by the Zend\XmlRpc\Client object and as the return value for those calls.

This object as a very important static function Zend\XmlRpc\Value::getXmlRpcValue, this function acts likes a factory for the Zend\XmlRpc\Value objects

Using this function, users/Zend\XmlRpc\Client object can create the Zend\XmlRpc\Value objects from PHP variables, XML string or by specifying the exact XML-RPC native type

 Methods

Generate XML code that represent a native XML/RPC value

generateXml() : void

Get XML generator instance

getGenerator() : \Zend\XmlRpc\Generator\GeneratorInterface

Get the native XML-RPC type (the type is one of the Value::XMLRPC_TYPE_* constants)

getType() : string

Returns

string

Return the value of this object, convert the XML-RPC native value into a PHP variable

getValue() : mixed

Returns

mixed

Get XML-RPC type for a PHP native variable

getXmlRpcTypeByValue(mixed $value) : string

static

Parameters

$value

mixed

Exceptions

\Zend\XmlRpc\Exception\InvalidArgumentException

Returns

string

Creates a Value* object, representing a native XML-RPC value A XmlRpcValue object can be created in 3 ways: 1.

getXmlRpcValue(mixed $value, \Zend\XmlRpc\Zend\XmlRpc\Value::constant $type) : \Zend\XmlRpc\AbstractValue

Autodetecting the native type out of a PHP variable (if $type is not set or equal to Value::AUTO_DETECT_TYPE) 2. By specifying the native type ($type is one of the Value::XMLRPC_TYPE_* constants) 3. From a XML string ($type is set to Value::XML_STRING)

By default the value type is autodetected according to it's PHP type

Parameters

$value

mixed

$type

\Zend\XmlRpc\Zend\XmlRpc\Value::constant

Exceptions

\Zend\XmlRpc\Exception\ValueException

Returns

Return the XML code that represent a native MXL-RPC value

saveXml() : string

Returns

string

Changes the encoding of the generator

setEncoding(string $encoding) : void

Parameters

$encoding

string

Sets XML generator instance

setGenerator(\Zend\XmlRpc\Generator\GeneratorInterface $generator) : void

Parameters

_createSimpleXMLElement()

_createSimpleXMLElement($xml) 

Parameters

$xml

Extract XML/RPC type and value from SimpleXMLElement object

_extractTypeAndValue(\SimpleXMLElement $xml, string $type, string $value) : void

Parameters

$type

string

&$type Type bind variable

$value

string

&$value Value bind variable

Transform a PHP native variable into a XML-RPC native value

_phpVarToNativeXmlRpc(mixed $value) : \Zend\XmlRpc\AbstractValue

static

Parameters

$value

mixed

The PHP variable for conversion

Exceptions

\Zend\XmlRpc\Exception\InvalidArgumentException

Returns

_setXML()

_setXML($xml) : void

Parameters

$xml

Transform an XML string into a XML-RPC native value

_xmlStringToNativeXmlRpc(string | \SimpleXMLElement $xml) : \Zend\XmlRpc\AbstractValue

static

Parameters

$xml

string\SimpleXMLElement

A SimpleXMLElement object represent the XML string It can be also a valid XML string for conversion

Exceptions

\Zend\XmlRpc\Exception\ValueException

Returns

 Properties

 

$generator

$generator : \Zend\XmlRpc\Generator\GeneratorInterface

 

The native XML-RPC type of this object One of the XMLRPC_TYPE_* constants

$type 

 

The native XML-RPC representation of this object's value

$value 

If the native type of this object is array or struct, this will be an array of Value objects

 

XML code representation of this object (will be calculated only once)

$xml 

 Constants

 

Specify that the XML-RPC native type will be auto detected from a PHP variable type

AUTO_DETECT_TYPE 

 

XMLRPC_TYPE_APACHEI8

XMLRPC_TYPE_APACHEI8 

 

XMLRPC_TYPE_APACHENIL

XMLRPC_TYPE_APACHENIL 

 

XMLRPC_TYPE_ARRAY

XMLRPC_TYPE_ARRAY 

 

XMLRPC_TYPE_BASE64

XMLRPC_TYPE_BASE64 

 

XMLRPC_TYPE_BOOLEAN

XMLRPC_TYPE_BOOLEAN 

 

XMLRPC_TYPE_DATETIME

XMLRPC_TYPE_DATETIME 

 

XMLRPC_TYPE_DOUBLE

XMLRPC_TYPE_DOUBLE 

 

All the XML-RPC native types

XMLRPC_TYPE_I4 

 

XMLRPC_TYPE_I8

XMLRPC_TYPE_I8 

 

XMLRPC_TYPE_INTEGER

XMLRPC_TYPE_INTEGER 

 

XMLRPC_TYPE_NIL

XMLRPC_TYPE_NIL 

 

XMLRPC_TYPE_STRING

XMLRPC_TYPE_STRING 

 

XMLRPC_TYPE_STRUCT

XMLRPC_TYPE_STRUCT 

 

Specify that the XML-RPC value will be parsed out from a given XML code

XML_STRING