Zend Framework  1.12
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Zend_XmlRpc_Value Class Reference

Public Member Functions

 getType ()
 Get the native XML-RPC type (the type is one of the Zend_XmlRpc_Value::XMLRPC_TYPE_* constants)
 
 getValue ()
 Return the value of this object, convert the XML-RPC native value into a PHP variable.
 
 saveXml ()
 Return the XML code that represent a native MXL-RPC value.
 
 generateXml ()
 Generate XML code that represent a native XML/RPC value.
 

Static Public Member Functions

static getGenerator ()
 Get XML generator instance.
 
static setGenerator (Zend_XmlRpc_Generator_GeneratorAbstract $generator)
 Sets XML generator instance.
 
static setEncoding ($encoding)
 Changes the encoding of the generator.
 
static getXmlRpcValue ($value, $type=self::AUTO_DETECT_TYPE)
 Creates a Zend_XmlRpc_Value* object, representing a native XML-RPC value A XmlRpcValue object can be created in 3 ways: 1.
 
static getXmlRpcTypeByValue ($value)
 Get XML-RPC type for a PHP native variable.
 

Public Attributes

const AUTO_DETECT_TYPE = 'auto_detect'
 Specify that the XML-RPC native type will be auto detected from a PHP variable type.
 
const XML_STRING = 'xml'
 Specify that the XML-RPC value will be parsed out from a given XML code.
 
const XMLRPC_TYPE_I4 = 'i4'
 All the XML-RPC native types.
 
const XMLRPC_TYPE_INTEGER = 'int'
 
const XMLRPC_TYPE_I8 = 'i8'
 
const XMLRPC_TYPE_APACHEI8 = 'ex:i8'
 
const XMLRPC_TYPE_DOUBLE = 'double'
 
const XMLRPC_TYPE_BOOLEAN = 'boolean'
 
const XMLRPC_TYPE_STRING = 'string'
 
const XMLRPC_TYPE_DATETIME = 'dateTime.iso8601'
 
const XMLRPC_TYPE_BASE64 = 'base64'
 
const XMLRPC_TYPE_ARRAY = 'array'
 
const XMLRPC_TYPE_STRUCT = 'struct'
 
const XMLRPC_TYPE_NIL = 'nil'
 
const XMLRPC_TYPE_APACHENIL = 'ex:nil'
 

Protected Member Functions

 _setXML ($xml)
 

Static Protected Member Functions

static _phpVarToNativeXmlRpc ($value)
 Transform a PHP native variable into a XML-RPC native value.
 
static _xmlStringToNativeXmlRpc ($xml)
 Transform an XML string into a XML-RPC native value.
 
static _createSimpleXMLElement (&$xml)
 
static _extractTypeAndValue (SimpleXMLElement $xml, &$type, &$value)
 Extract XML/RPC type and value from SimpleXMLElement object.
 

Protected Attributes

 $_value
 The native XML-RPC representation of this object's value.
 
 $_type
 The native XML-RPC type of this object One of the XMLRPC_TYPE_* constants.
 
 $_xml
 XML code representation of this object (will be calculated only once)
 

Static Protected Attributes

static $_generator
 

Member Function Documentation

static _createSimpleXMLElement ( $xml)
staticprotected
static _extractTypeAndValue ( SimpleXMLElement  $xml,
$type,
$value 
)
staticprotected

Extract XML/RPC type and value from SimpleXMLElement object.

Parameters
SimpleXMLElement$xml
string&$typeType bind variable
string&$valueValue bind variable
Returns
void
static _phpVarToNativeXmlRpc (   $value)
staticprotected

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

Parameters
mixed$valueThe PHP variable for convertion
Returns
Zend_XmlRpc_Value
_setXML (   $xml)
protected
Parameters
string$xml
Returns
void
static _xmlStringToNativeXmlRpc (   $xml)
staticprotected

Transform an XML string into a XML-RPC native value.

Parameters
string | SimpleXMLElement$xmlA SimpleXMLElement object represent the XML string It can be also a valid XML string for convertion
Returns
Zend_XmlRpc_Value
generateXml ( )

Generate XML code that represent a native XML/RPC value.

Returns
void
static getGenerator ( )
static

Get XML generator instance.

Returns
Zend_XmlRpc_Generator_GeneratorAbstract
getType ( )

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

Returns
string
getValue ( )
abstract

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

Returns
mixed
static getXmlRpcTypeByValue (   $value)
static

Get XML-RPC type for a PHP native variable.

Parameters
mixed$value
Returns
string
static getXmlRpcValue (   $value,
  $type = self::AUTO_DETECT_TYPE 
)
static

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

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

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

Parameters
mixed$value
Zend_XmlRpc_Value::constant$type
Returns
Zend_XmlRpc_Value
saveXml ( )

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

Returns
string
static setEncoding (   $encoding)
static

Changes the encoding of the generator.

Parameters
string$encoding
Returns
void
static setGenerator ( Zend_XmlRpc_Generator_GeneratorAbstract  $generator)
static

Sets XML generator instance.

Parameters
Zend_XmlRpc_Generator_GeneratorAbstract$generator
Returns
void

Member Data Documentation

$_generator
staticprotected
$_type
protected

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

$_value
protected

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

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

$_xml
protected

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

const AUTO_DETECT_TYPE = 'auto_detect'

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

const XML_STRING = 'xml'

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

const XMLRPC_TYPE_APACHEI8 = 'ex:i8'
const XMLRPC_TYPE_APACHENIL = 'ex:nil'
const XMLRPC_TYPE_ARRAY = 'array'
const XMLRPC_TYPE_BASE64 = 'base64'
const XMLRPC_TYPE_BOOLEAN = 'boolean'
const XMLRPC_TYPE_DATETIME = 'dateTime.iso8601'
const XMLRPC_TYPE_DOUBLE = 'double'
const XMLRPC_TYPE_I4 = 'i4'

All the XML-RPC native types.

const XMLRPC_TYPE_I8 = 'i8'
const XMLRPC_TYPE_INTEGER = 'int'
const XMLRPC_TYPE_NIL = 'nil'
const XMLRPC_TYPE_STRING = 'string'
const XMLRPC_TYPE_STRUCT = 'struct'