|
static | createFromNative ($value, $explicitType) |
| Factory method that constructs the appropriate XML-RPC encoded type value. More...
|
|
Definition at line 57 of file Value.php.
◆ createFromNative()
static XML_RPC2_Backend_Xmlrpcext_Value::createFromNative |
( |
|
$value, |
|
|
|
$explicitType |
|
) |
| |
|
static |
Factory method that constructs the appropriate XML-RPC encoded type value.
- Parameters
-
mixed | Value to be encode |
string | Explicit XML-RPC type as enumerated in the XML-RPC spec (defaults to automatically selected type) |
- Returns
- mixed The encoded value
Definition at line 69 of file Value.php.
70 {
71 $type = strtolower($explicitType);
72 $availableTypes = array('datetime', 'base64', 'struct');
73 if (in_array($type, $availableTypes)) {
74 if ($type=='struct') {
75 if (!(is_array($value))) {
77 }
78
79
80
81 $new = array();
82 while (list($k, $v) = each($value)) {
83 $new["xml_rpc2_ugly_struct_hack_$k"] = $v;
84
85 }
86 return $new;
87 }
88 $value2 = (string) $value;
89 if (!xmlrpc_set_type($value2, $type)) {
91 }
92 return $value2;
93 }
94 return $value;
95 }
The documentation for this class was generated from the following file:
- Services/PEAR/lib/XML/RPC2/Backend/Xmlrpcext/Value.php