Zend Framework  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Request Class Reference

XmlRpc Request object. More...

Public Member Functions

 __construct ($method=null, $params=null)
 Create a new XML-RPC request.
 
 setEncoding ($encoding)
 Set encoding to use in request.
 
 getEncoding ()
 Retrieve current request encoding.
 
 setMethod ($method)
 Set method to call.
 
 getMethod ()
 Retrieve call method.
 
 addParam ($value, $type=null)
 Add a parameter to the parameter stack.
 
 setParams ()
 Set the parameters array.
 
 getParams ()
 Retrieve the array of parameters.
 
 getTypes ()
 Return parameter types.
 
 loadXml ($request)
 Load XML and parse into request components.
 
 isFault ()
 Does the current request contain errors and should it return a fault response?
 
 getFault ()
 Retrieve the fault response, if any.
 
 saveXml ()
 Create XML request.
 
 __toString ()
 Return XML request.
 

Protected Member Functions

 getXmlRpcParams ()
 Retrieve method parameters as XMLRPC values.
 

Protected Attributes

 $encoding = 'UTF-8'
 
 $method
 
 $xml
 
 $params = []
 
 $fault = null
 
 $types = []
 
 $xmlRpcParams = []
 

Detailed Description

XmlRpc Request object.

Encapsulates an XmlRpc request, holding the method call and all parameters. Provides accessors for these, as well as the ability to load from XML and to create the XML request string.

Additionally, if errors occur setting the method or parsing XML, a fault is generated and stored in $fault; developers may check for it using isFault() and getFault().

Constructor & Destructor Documentation

__construct (   $method = null,
  $params = null 
)

Create a new XML-RPC request.

Parameters
string$method(optional)
array$params(optional)

Member Function Documentation

__toString ( )

Return XML request.

Returns
string
addParam (   $value,
  $type = null 
)

Add a parameter to the parameter stack.

Adds a parameter to the parameter stack, associating it with the type $type if provided

Parameters
mixed$value
string$typeOptional; type hinting
Returns
void
getEncoding ( )

Retrieve current request encoding.

Returns
string
getFault ( )

Retrieve the fault response, if any.

Returns
null|
getMethod ( )

Retrieve call method.

Returns
string
getParams ( )

Retrieve the array of parameters.

Returns
array
getTypes ( )

Return parameter types.

Returns
array
getXmlRpcParams ( )
protected

Retrieve method parameters as XMLRPC values.

Returns
array
isFault ( )

Does the current request contain errors and should it return a fault response?

Returns
bool
loadXml (   $request)

Load XML and parse into request components.

Parameters
string$request
Exceptions
Exception\ValueExceptionif invalid XML
Returns
bool True on success, false if an error occurred.
saveXml ( )

Create XML request.

Returns
string
setEncoding (   $encoding)

Set encoding to use in request.

Parameters
string$encoding
Returns
setMethod (   $method)

Set method to call.

Parameters
string$method
Returns
bool Returns true on success, false if method name is invalid
setParams ( )

Set the parameters array.

If called with a single, array value, that array is used to set the parameters stack. If called with multiple values or a single non-array value, the arguments are used to set the parameters stack.

Best is to call with array of the format, in order to allow type hinting when creating the XMLRPC values for each parameter: $array = array( array( 'value' => $value, 'type' => $type )[, ... ] );

public

Returns
void

Member Data Documentation

$encoding = 'UTF-8'
protected
$fault = null
protected
$method
protected
$params = []
protected
$types = []
protected
$xml
protected
$xmlRpcParams = []
protected