Open Monograph Press  3.3.0
PhpXmlRpc\Value Class Reference
Inheritance diagram for PhpXmlRpc\Value:

Public Member Functions

 __construct ($val=-1, $type='')
 
 addArray ($values)
 
 addScalar ($val, $type='string')
 
 addStruct ($values)
 
 arraymem ($key)
 
 arraysize ()
 
 count ()
 
 getIterator ()
 
 kindOf ()
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 scalartyp ()
 
 scalarval ()
 
 serialize ($charsetEncoding='')
 
 structeach ()
 
 structmem ($key)
 
 structmemexists ($key)
 
 structreset ()
 
 structsize ()
 

Data Fields

 $_php_class = null
 
 $me = array()
 
 $mytype = 0
 

Static Public Attributes

static $xmlrpcArray = "array"
 
static $xmlrpcBase64 = "base64"
 
static $xmlrpcBoolean = "boolean"
 
static $xmlrpcDateTime = "dateTime.iso8601"
 
static $xmlrpcDouble = "double"
 
static $xmlrpcI4 = "i4"
 
static $xmlrpcInt = "int"
 
static $xmlrpcNull = "null"
 
static $xmlrpcString = "string"
 
static $xmlrpcStruct = "struct"
 
static $xmlrpcTypes
 
static $xmlrpcValue = "undefined"
 

Protected Member Functions

 serializedata ($typ, $val, $charsetEncoding='')
 

Detailed Description

Definition at line 7 of file Value.php.

Constructor & Destructor Documentation

◆ __construct()

PhpXmlRpc\Value::__construct (   $val = -1,
  $type = '' 
)

Build an xmlrpc value. When no value or type is passed in, the value is left uninitialized, and the value can be added later

Parameters
mixed$val
string$typeany valid xmlrpc type name (lowercase). If null, 'string' is assumed

Definition at line 46 of file Value.php.

Member Function Documentation

◆ addArray()

PhpXmlRpc\Value::addArray (   $values)

Add an array of xmlrpc values objects to an xmlrpc value.

Parameters
Value[]$values
Returns
int 1 or 0 on failure
Todo:
add some checking for $values to be an array of xmlrpc values?

Definition at line 142 of file Value.php.

◆ addScalar()

PhpXmlRpc\Value::addScalar (   $val,
  $type = 'string' 
)

Add a single php value to an (uninitialized) xmlrpc value.

Parameters
mixed$val
string$type
Returns
int 1 or 0 on failure

Definition at line 89 of file Value.php.

◆ addStruct()

PhpXmlRpc\Value::addStruct (   $values)

Add an array of named xmlrpc value objects to an xmlrpc value.

Parameters
Value[]$values
Returns
int 1 or 0 on failure
Todo:
add some checking for $values to be an array?

Definition at line 169 of file Value.php.

◆ arraymem()

PhpXmlRpc\Value::arraymem (   $key)

Returns the m-th member of an xmlrpc value of struct type.

Parameters
integer$keythe index of the value to be retrieved (zero based)
Returns
Value
Deprecated:
use array access, e.g. $val[$key]

Definition at line 409 of file Value.php.

◆ arraysize()

PhpXmlRpc\Value::arraysize ( )

Returns the number of members in an xmlrpc value of array type.

Returns
integer
Deprecated:
use count() instead

Definition at line 421 of file Value.php.

◆ count()

PhpXmlRpc\Value::count ( )

Returns the number of members in an xmlrpc value:

  • 0 for uninitialized values
  • 1 for scalars
  • the number of elements for structs and arrays
Returns
integer

Definition at line 446 of file Value.php.

◆ getIterator()

PhpXmlRpc\Value::getIterator ( )

Implements the IteratorAggregate interface

Returns
ArrayIterator

Definition at line 465 of file Value.php.

◆ kindOf()

PhpXmlRpc\Value::kindOf ( )

Returns a string containing "struct", "array", "scalar" or "undef" describing the base type of the value.

Returns
string

Definition at line 192 of file Value.php.

◆ offsetExists()

PhpXmlRpc\Value::offsetExists (   $offset)

Definition at line 520 of file Value.php.

◆ offsetGet()

PhpXmlRpc\Value::offsetGet (   $offset)

Definition at line 550 of file Value.php.

◆ offsetSet()

PhpXmlRpc\Value::offsetSet (   $offset,
  $value 
)

Definition at line 480 of file Value.php.

◆ offsetUnset()

PhpXmlRpc\Value::offsetUnset (   $offset)

Definition at line 534 of file Value.php.

◆ scalartyp()

PhpXmlRpc\Value::scalartyp ( )

Returns the type of the xmlrpc value. For integers, 'int' is always returned in place of 'i4'.

Returns
string

Definition at line 389 of file Value.php.

◆ scalarval()

PhpXmlRpc\Value::scalarval ( )

Returns the value of a scalar xmlrpc value.

Returns
mixed

Definition at line 375 of file Value.php.

◆ serialize()

PhpXmlRpc\Value::serialize (   $charsetEncoding = '')

Returns xml representation of the value. XML prologue not included.

Parameters
string$charsetEncodingthe charset to be used for serialization. if null, US-ASCII is assumed
Returns
string

Definition at line 307 of file Value.php.

◆ serializedata()

PhpXmlRpc\Value::serializedata (   $typ,
  $val,
  $charsetEncoding = '' 
)
protected

Definition at line 209 of file Value.php.

◆ structeach()

PhpXmlRpc\Value::structeach ( )

Return next member element for xmlrpc values of type struct.

Returns
Value
Deprecated:
iterate directly over the object using foreach instead

Definition at line 365 of file Value.php.

◆ structmem()

PhpXmlRpc\Value::structmem (   $key)

Returns the value of a given struct member (an xmlrpc value object in itself). Will raise a php warning if struct member of given name does not exist.

Parameters
string$keythe name of the struct member to be looked up
Returns
Value
Deprecated:
use array access, e.g. $val[$key]

Definition at line 344 of file Value.php.

◆ structmemexists()

PhpXmlRpc\Value::structmemexists (   $key)

Checks whether a struct member with a given name is present. Works only on xmlrpc values of type struct.

Parameters
string$keythe name of the struct member to be looked up
Returns
boolean
Deprecated:
use array access, e.g. isset($val[$key])

Definition at line 329 of file Value.php.

◆ structreset()

PhpXmlRpc\Value::structreset ( )

Reset internal pointer for xmlrpc values of type struct.

Deprecated:
iterate directly over the object using foreach instead

Definition at line 353 of file Value.php.

◆ structsize()

PhpXmlRpc\Value::structsize ( )

Returns the number of members in an xmlrpc value of struct type.

Returns
integer
Deprecated:
use count() instead

Definition at line 433 of file Value.php.

Field Documentation

◆ $_php_class

PhpXmlRpc\Value::$_php_class = null

Definition at line 37 of file Value.php.

◆ $me

PhpXmlRpc\Value::$me = array()
Todo:
: do these need to be public?

Definition at line 35 of file Value.php.

◆ $mytype

PhpXmlRpc\Value::$mytype = 0

Definition at line 36 of file Value.php.

◆ $xmlrpcArray

PhpXmlRpc\Value::$xmlrpcArray = "array"
static

Definition at line 16 of file Value.php.

◆ $xmlrpcBase64

PhpXmlRpc\Value::$xmlrpcBase64 = "base64"
static

Definition at line 15 of file Value.php.

◆ $xmlrpcBoolean

PhpXmlRpc\Value::$xmlrpcBoolean = "boolean"
static

Definition at line 11 of file Value.php.

◆ $xmlrpcDateTime

PhpXmlRpc\Value::$xmlrpcDateTime = "dateTime.iso8601"
static

Definition at line 14 of file Value.php.

Referenced by PhpXmlRpc\Helper\XMLParser\xmlrpc_ee().

◆ $xmlrpcDouble

PhpXmlRpc\Value::$xmlrpcDouble = "double"
static

Definition at line 12 of file Value.php.

◆ $xmlrpcI4

PhpXmlRpc\Value::$xmlrpcI4 = "i4"
static

Definition at line 9 of file Value.php.

◆ $xmlrpcInt

PhpXmlRpc\Value::$xmlrpcInt = "int"
static

Definition at line 10 of file Value.php.

◆ $xmlrpcNull

PhpXmlRpc\Value::$xmlrpcNull = "null"
static

Definition at line 19 of file Value.php.

◆ $xmlrpcString

PhpXmlRpc\Value::$xmlrpcString = "string"
static

Definition at line 13 of file Value.php.

Referenced by PhpXmlRpc\Helper\XMLParser\xmlrpc_ee().

◆ $xmlrpcStruct

PhpXmlRpc\Value::$xmlrpcStruct = "struct"
static

Definition at line 17 of file Value.php.

◆ $xmlrpcTypes

PhpXmlRpc\Value::$xmlrpcTypes
static
Initial value:
= array(
"i4" => 1,
"int" => 1,
"boolean" => 1,
"double" => 1,
"string" => 1,
"dateTime.iso8601" => 1,
"base64" => 1,
"array" => 2,
"struct" => 3,
"null" => 1,
)

Definition at line 21 of file Value.php.

◆ $xmlrpcValue

PhpXmlRpc\Value::$xmlrpcValue = "undefined"
static

Definition at line 18 of file Value.php.


The documentation for this class was generated from the following file: