XmlRpc/Value.php
Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_XmlRpc
- Subpackage
- Value
- Version
- $Id: Value.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_XmlRpc_Value
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 specifing the exact XML-RPC natvie type
- Children
- \Zend_XmlRpc_Value_Collection
- \Zend_XmlRpc_Value_Scalar
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Constants
AUTO_DETECT_TYPE
= 'auto_detect'Specify that the XML-RPC native type will be auto detected from a PHP variable type
Properties

$_value = 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
- Type
- n/a
Methods

_extractTypeAndValue(\SimpleXMLElement $xml, string $type, string $value) : voidExtract XML/RPC type and value from SimpleXMLElement object
| Name | Type | Description |
|---|---|---|
| $xml | \SimpleXMLElement | |
| $type | string | &$type Type bind variable |
| $value | string | &$value Value bind variable |

_phpVarToNativeXmlRpc(mixed $value) : \Zend_XmlRpc_ValueTransform a PHP native variable into a XML-RPC native value
| Name | Type | Description |
|---|---|---|
| $value | mixed | The PHP variable for convertion |
| Type | Description |
|---|---|
| \Zend_XmlRpc_Value |
- Static

_xmlStringToNativeXmlRpc(string | \SimpleXMLElement $xml) : \Zend_XmlRpc_ValueTransform an XML string into a XML-RPC native value
| Name | Type | Description |
|---|---|---|
| $xml | string | \SimpleXMLElement | A SimpleXMLElement object represent the XML string It can be also a valid XML string for convertion |
| Type | Description |
|---|---|
| \Zend_XmlRpc_Value |
- Static

getGenerator() : \Zend_XmlRpc_Generator_GeneratorAbstractGet XML generator instance
| Type | Description |
|---|---|
| \Zend_XmlRpc_Generator_GeneratorAbstract |

getType() : stringGet the native XML-RPC type (the type is one of the Zend_XmlRpc_Value::XMLRPC_TYPE_* constants)
| Type | Description |
|---|---|
| string |

getValue() : mixedReturn the value of this object, convert the XML-RPC native value into a PHP variable
| Type | Description |
|---|---|
| mixed |

getXmlRpcTypeByValue(mixed $value) : stringGet XML-RPC type for a PHP native variable
| Name | Type | Description |
|---|---|---|
| $value | mixed |
| Type | Description |
|---|---|
| string |
- Static

getXmlRpcValue(mixed $value, \Zend_XmlRpc_Value::constant $type = self::AUTO_DETECT_TYPE) : \Zend_XmlRpc_ValueCreates 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
| Name | Type | Description |
|---|---|---|
| $value | mixed | |
| $type | \Zend_XmlRpc_Value::constant |
| Type | Description |
|---|---|
| \Zend_XmlRpc_Value |
- Static

saveXml() : stringReturn the XML code that represent a native MXL-RPC value
| Type | Description |
|---|---|
| string |

setEncoding(string $encoding) : voidChanges the encoding of the generator
| Name | Type | Description |
|---|---|---|
| $encoding | string |

setGenerator(\Zend_XmlRpc_Generator_GeneratorAbstract $generator) : voidSets XML generator instance
| Name | Type | Description |
|---|---|---|
| $generator | \Zend_XmlRpc_Generator_GeneratorAbstract |