Zend\XmlRpc\AbstractValue
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
Synopsis
class AbstractValue
{
- // constants
- const AUTO_DETECT_TYPE = 'auto_detect';
- const XML_STRING = 'xml';
- const XMLRPC_TYPE_I4 = 'i4';
- 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';
- // members
- protected $value;
- protected $type;
- protected $xml;
- protected GeneratorInterface $generator;
- // methods
- public string getType()
- public static GeneratorInterface getGenerator()
- public static void setGenerator()
- public static void setEncoding()
- public abstract mixed getValue()
- public string saveXml()
- public void generateXml()
- public static AbstractValue getXmlRpcValue()
- public static string getXmlRpcTypeByValue()
- protected static AbstractValue _phpVarToNativeXmlRpc()
- protected static AbstractValue _xmlStringToNativeXmlRpc()
- protected static void _createSimpleXMLElement()
- protected static void _extractTypeAndValue()
- protected void _setXML()
Hierarchy
Extended by
- Zend\XmlRpc\Value\BigInteger
- Zend\XmlRpc\Value\Integer
- Zend\XmlRpc\Value\DateTime
- Zend\XmlRpc\Value\Boolean
- Zend\XmlRpc\Value\Nil
- Zend\XmlRpc\Value\ArrayValue
- Zend\XmlRpc\Value\AbstractCollection
- Zend\XmlRpc\Value\Base64
- Zend\XmlRpc\Value\Struct
- Zend\XmlRpc\Value\String
- Zend\XmlRpc\Value\Double
- Zend\XmlRpc\Value\AbstractScalar
Constants
Name | Value |
---|---|
AUTO_DETECT_TYPE | 'auto_detect' |
XML_STRING | 'xml' |
XMLRPC_TYPE_I4 | 'i4' |
XMLRPC_TYPE_INTEGER | 'int' |
XMLRPC_TYPE_I8 | 'i8' |
XMLRPC_TYPE_APACHEI8 | 'ex:i8' |
XMLRPC_TYPE_DOUBLE | 'double' |
XMLRPC_TYPE_BOOLEAN | 'boolean' |
XMLRPC_TYPE_STRING | 'string' |
XMLRPC_TYPE_DATETIME | 'dateTime.iso8601' |
XMLRPC_TYPE_BASE64 | 'base64' |
XMLRPC_TYPE_ARRAY | 'array' |
XMLRPC_TYPE_STRUCT | 'struct' |
XMLRPC_TYPE_NIL | 'nil' |
XMLRPC_TYPE_APACHENIL | 'ex:nil' |
Members
protected
- $generator — \Zend\XmlRpc\Generator\GeneratorInterface
-
$type
The native XML-RPC type of this object One of the XMLRPC_TYPE_* constants -
$value
The native XML-RPC representation of this object's value -
$xml
XML code representation of this object (will be calculated only once)
Methods
protected
- _createSimpleXMLElement()
- _extractTypeAndValue() — Extract XML/RPC type and value from SimpleXMLElement object
- _phpVarToNativeXmlRpc() — Transform a PHP native variable into a XML-RPC native value
- _setXML()
- _xmlStringToNativeXmlRpc() — Transform an XML string into a XML-RPC native value
public
- generateXml() — Generate XML code that represent a native XML/RPC value
- getGenerator() — Get XML generator instance
- getType() — Get the native XML-RPC type (the type is one of the Value::XMLRPC_TYPE_* constants)
- getValue() — Return the value of this object, convert the XML-RPC native value into a PHP variable
- getXmlRpcTypeByValue() — Get XML-RPC type for a PHP native variable
- getXmlRpcValue() — Creates a 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 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)
- saveXml() — Return the XML code that represent a native MXL-RPC value
- setEncoding() — Changes the encoding of the generator
- setGenerator() — Sets XML generator instance