Json/Server/Request.php

Show: PublicProtectedPrivateinherited
Table of Contents
Zend Framework
LICENSE This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to [email protected] so we can send you a copy immediately.
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Json  
Subpackage
Server  
Version
$Id$  

\Zend_Json_Server_Request

Package: Zend_Json\Server
Children
\Zend_Json_Server_Request_Http
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

>VPropertyprotectedmixed $_id
Request ID
Details
Type
mixed
>VPropertyprotectedbool $_isMethodError = false
Flag
Default valuefalseDetails
Type
bool
>VPropertyprotectedstring $_method
Requested method
Details
Type
string
>VPropertyprotectedstring $_methodRegex = '/^[a-z][a-z0-9_.]*$/i'
Regex for method
Default value'/^[a-z][a-z0-9_.]*$/i'Details
Type
string
>VPropertyprotectedarray $_params = array()
Request parameters
Default valuearray()Details
Type
array
>VPropertyprotectedstring $_version = '1.0'
JSON-RPC version of request
Default value'1.0'Details
Type
string

Methods

methodpublic__toString() : string

Cast request to string (JSON)

Returns
TypeDescription
string
methodpublicaddParam(mixed $value, string $key = null) : \Zend_Json_Server_Request

Add a parameter to the request

Parameters
NameTypeDescription
$valuemixed
$keystring
Returns
TypeDescription
\Zend_Json_Server_Request
methodpublicaddParams(array $params) : \Zend_Json_Server_Request

Add many params

Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
\Zend_Json_Server_Request
methodpublicgetId() : mixed

Retrieve request identifier

Returns
TypeDescription
mixed
methodpublicgetMethod() : string

Get request method name

Returns
TypeDescription
string
methodpublicgetParam(int | string $index) : mixed | null

Retrieve param by index or key

Parameters
NameTypeDescription
$indexint | string
Returns
TypeDescription
mixed | nullNull when not found
methodpublicgetParams() : array

Retrieve parameters

Returns
TypeDescription
array
methodpublicgetVersion() : string

Retrieve JSON-RPC version

Returns
TypeDescription
string
methodpublicisMethodError() : bool

Was a bad method provided?

Returns
TypeDescription
bool
methodpublicloadJson(string $json) : void

Set request state based on JSON

Parameters
NameTypeDescription
$jsonstring
methodpublicsetId(mixed $name) : \Zend_Json_Server_Request

Set request identifier

Parameters
NameTypeDescription
$namemixed
Returns
TypeDescription
\Zend_Json_Server_Request
methodpublicsetMethod(string $name) : \Zend_Json_Server_Request

Set request method

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
\Zend_Json_Server_Request
methodpublicsetOptions(array $options) : \Zend_Json_Server_Request

Set request state

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Json_Server_Request
methodpublicsetParams(array $params) : \Zend_Json_Server_Request

Overwrite params

Parameters
NameTypeDescription
$paramsarray
Returns
TypeDescription
\Zend_Json_Server_Request
methodpublicsetVersion(string $version) : \Zend_Json_Server_Request

Set JSON-RPC version

Parameters
NameTypeDescription
$versionstring
Returns
TypeDescription
\Zend_Json_Server_Request
methodpublictoJson() : string

Cast request to JSON

Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.2.0 .