Hoa central
Public Member Functions | Protected Attributes | List of all members
Hoa\XmlRpc\Message\Request Class Reference
Inheritance diagram for Hoa\XmlRpc\Message\Request:

Public Member Functions

 __construct ($method)
 
 getMethod ()
 
 __toString ()
 
- Public Member Functions inherited from Hoa\XmlRpc\Message\Message
 __construct ($is=self::IS_SCALAR, $parent=null)
 
 withArray ()
 
 endArray ()
 
 withBase64 ($data)
 
 withBoolean ($data)
 
 withDateTime ($timestamp)
 
 withFloat ($float)
 
 withInteger ($integer)
 
 withString ($string)
 
 withStructure ()
 
 withName ($name)
 
 endStructure ()
 
 withNull ()
 
 getParent ()
 
 getValues ()
 
 getValueAsString ($value, $type)
 
 getFormattedValues ()
 

Protected Attributes

 $_method = null
 
- Protected Attributes inherited from Hoa\XmlRpc\Message\Message
 $_values = []
 
 $_parent = null
 
 $_name = 'undefined'
 
 $_is = self::IS_SCALAR
 

Additional Inherited Members

- Public Attributes inherited from Hoa\XmlRpc\Message\Message
const VALUE = 0
 
const TYPE = 1
 
const TYPE_ARRAY = 2
 
const TYPE_BASE64 = 3
 
const TYPE_BOOLEAN = 4
 
const TYPE_DATETIME = 5
 
const TYPE_FLOAT = 6
 
const TYPE_INTEGER = 7
 
const TYPE_STRING = 8
 
const TYPE_STRUCTURE = 9
 
const TYPE_NULL = 10
 
const IS_SCALAR = 11
 
const IS_ARRAY = 12
 
const IS_STRUCTURE = 13
 
- Protected Member Functions inherited from Hoa\XmlRpc\Message\Message
 _with ($value, $type)
 
 setParent ($parent)
 
 _getFormattedValues ($values)
 
 computeValues ($values, $self=null)
 

Detailed Description

Class .

Represent a request message.

Definition at line 47 of file Request.php.

Constructor & Destructor Documentation

Hoa\XmlRpc\Message\Request::__construct (   $method)

Construct a new request.

Parameters
string$methodMethod to call.
Returns
void

Definition at line 64 of file Request.php.

65  {
66  $this->_method = $method;
67  parent::__construct(parent::IS_SCALAR, null);
68 
69  return;
70  }

Member Function Documentation

Hoa\XmlRpc\Message\Request::__toString ( )

Transform the message into a XML string.

Returns
string

Definition at line 87 of file Request.php.

88  {
89  $out =
90  '<?xml version="1.0" encoding="utf-8"?' . '>' . "\n" .
91  '<methodCall>' . "\n" .
92  ' <methodName>' . $this->getMethod() . '</methodName>' . "\n";
93 
94  $values = $this->getValues();
95 
96  if (!empty($values)) {
97  $out .= ' <params>' . "\n";
98 
99  foreach ($this->getValues() as $value) {
100  $out .=
101  ' <param>' . "\n" . ' <value>' .
102  str_replace(
103  "\n",
104  "\n ",
105  $this->getValueAsString(
106  $value[self::VALUE],
107  $value[self::TYPE]
108  )
109  ) .
110  '</value>' . "\n" . ' </param>' . "\n";
111  }
112 
113  $out .= ' </params>' . "\n";
114  }
115 
116  return $out . '</methodCall>';
117  }
getValueAsString($value, $type)
Definition: Message.php:401

Here is the call graph for this function:

Hoa\XmlRpc\Message\Request::getMethod ( )

Get method to call.

Returns
string

Definition at line 77 of file Request.php.

78  {
79  return $this->_method;
80  }

Here is the caller graph for this function:

Member Data Documentation

Hoa\XmlRpc\Message\Request::$_method = null
protected

Definition at line 54 of file Request.php.


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