XML_RPC2
[ class tree: XML_RPC2 ] [ index: XML_RPC2 ] [ all elements ]

Class: XML_RPC2_Backend_Php_Value

Source Location: /XML_RPC2-1.1.2/XML/RPC2/Backend/Php/Value.php

Class Overview

XML_RPC2_Value
   |
   --XML_RPC2_Backend_Php_Value

XML_RPC value abstract class. All XML_RPC value classes inherit from XML_RPC2_Value


Author(s):

Copyright:

  • 2004-2005 Sergio Carvalho

Methods


Child classes:

XML_RPC2_Backend_Php_Value_Datetime
XML_RPC datetime value class. Instances of this class represent datetime scalars in XML_RPC
XML_RPC2_Backend_Php_Value_Base64
XML_RPC base64 value class. Instances of this class represent base64-encoded string scalars in XML_RPC
XML_RPC2_Backend_Php_Value_Scalar
XML_RPC scalar value abstract class. All XML_RPC value classes representing scalar types inherit from XML_RPC2_Value_Scalar
XML_RPC2_Backend_Php_Value_Array
XML_RPC array value class. Represents values of type array
XML_RPC2_Backend_Php_Value_Struct
XML_RPC struct value class. Represents values of type struct (associative struct)

Inherited Variables

Inherited Methods

Class: XML_RPC2_Value

XML_RPC2_Value::createFromNative()
Factory method that constructs the appropriate XML-RPC encoded type value

Class Details

[line 57]
XML_RPC value abstract class. All XML_RPC value classes inherit from XML_RPC2_Value


[ Top ]


Method Detail

createFromDecode   [line 222]

mixed createFromDecode( SimpleXMLElement $simpleXML)

Decode an encoded value and build the applicable XML_RPC2_Value subclass
  • Return: the corresponding XML_RPC2_Value object
  • Access: public

Parameters:

SimpleXMLElement   $simpleXML   —  The encoded XML-RPC value

[ Top ]

createFromNative   [line 125]

A createFromNative( mixed $nativeValue, [string $explicitType = null])

Choose a XML_RPC2_Value subclass appropriate for the given value and create it.

This method tries to find the most adequate XML-RPC datatype to hold a given PHP native type. Note that distinguishing some datatypes may be difficult:

  • Timestamps are represented by PHP integers, so an XML_RPC2_Value_Datetime is never returned
  • Indexed arrays and associative arrays are the same native PHP type. In this case: a) The array's indexes start at 0 or 1 and increase monotonically with step 1, or b) they do not in the first case, an XML_RPC2_Value_Array is returned. In the second, a XML_RPC2_Value_Struct is returned.
  • PHP Objects are serialized and represented in an XML_RPC2_Value_Base64
  • Integers fitting in a 32bit integer are encoded as regular xml-rpc integers
  • Integers larger than 32bit are encoded using the i8 xml-rpc extension
Whenever native object automatic detection proves inaccurate, use XML_RPC2_Value::createFromNative providing a valid explicit type as second argument

the appropriate XML_RPC2_Value child class instead.

  • Return: new XML_RPC2_Value instance
  • See: XML_RPC_Client::__call
  • See: XML_RPC_Server
  • Throws: XML_RPC2_InvalidTypeEncodeException When the native value has a type that can't be translated to XML_RPC
  • Access: public

Overridden in child classes as:

XML_RPC2_Backend_Php_Value_Scalar::createFromNative()
Choose a XML_RPC2_Value subclass appropriate for the given value and create it.

Overrides XML_RPC2_Value::createFromNative() (Factory method that constructs the appropriate XML-RPC encoded type value)

Parameters:

mixed   $nativeValue   —  The native value
string   $explicitType   —  The xml-rpc target encoding type, as per the xmlrpc spec (optional)

[ Top ]

getNativeValue   [line 76]

mixed getNativeValue( )

nativeValue property getter
  • Return: The current nativeValue
  • Access: public

[ Top ]

setNativeValue   [line 89]

void setNativeValue( mixed $value)

nativeValue setter
  • Access: protected

Overridden in child classes as:

XML_RPC2_Backend_Php_Value_Array::setNativeValue()
nativeValue property setter
XML_RPC2_Backend_Php_Value_Struct::setNativeValue()
nativeValue property setter

Parameters:

mixed   $value   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:56:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.