Json/Server/Smd/Service.php
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 license@zend.com 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
\Zend_Json_Server_Smd_Service
Package: Zend_Json\Server








Returns








Returns
Create Service Mapping Description for a method
- Copyright
- Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id$
Properties


$_envelope = \Zend_Json_Server_Smd::ENV_JSONRPC_1
Default value
\Zend_Json_Server_Smd::ENV_JSONRPC_1
Details- Type
- n/a


array $_envelopeTypes = array(\Zend_Json_Server_Smd::ENV_JSONRPC_1, \Zend_Json_Server_Smd::ENV_JSONRPC_2)
Allowed envelope types
Default value
array(\Zend_Json_Server_Smd::ENV_JSONRPC_1, \Zend_Json_Server_Smd::ENV_JSONRPC_2)
Details- Type
- array


string $_nameRegex = '/^[a-z][a-z0-9._]+$/i'
Regex for names
Default value
'/^[a-z][a-z0-9._]+$/i'
Details- Type
- string


array $_paramMap = array('any' => 'any', 'arr' => 'array', 'array' => 'array', 'assoc' => 'object', 'bool' => 'boolean', 'boolean' => 'boolean', 'dbl' => 'float', 'double' => 'float', 'false' => 'boolean', 'float' => 'float', 'hash' => 'object', 'integer' => 'integer', 'int' => 'integer', 'mixed' => 'any', 'nil' => 'null', 'null' => 'null', 'object' => 'object', 'string' => 'string', 'str' => 'string', 'struct' => 'object', 'true' => 'boolean', 'void' => 'null')
Mapping of parameter types to JSON-RPC types
Default value
array('any' => 'any', 'arr' => 'array', 'array' => 'array', 'assoc' => 'object', 'bool' => 'boolean', 'boolean' => 'boolean', 'dbl' => 'float', 'double' => 'float', 'false' => 'boolean', 'float' => 'float', 'hash' => 'object', 'integer' => 'integer', 'int' => 'integer', 'mixed' => 'any', 'nil' => 'null', 'null' => 'null', 'object' => 'object', 'string' => 'string', 'str' => 'string', 'struct' => 'object', 'true' => 'boolean', 'void' => 'null')
Details- Type
- array


array $_paramOptionTypes = array('name' => 'is_string', 'optional' => 'is_bool', 'default' => null, 'description' => 'is_string')
Parameter option types
Default value
array('name' => 'is_string', 'optional' => 'is_bool', 'default' => null, 'description' => 'is_string')
Details- Type
- array
Methods


__construct(string | array $spec) : void
Constructor
Parameters
Throws
Name | Type | Description |
---|---|---|
$spec | string | array |
Exception | Description |
---|---|
\Zend_Json_Server_Exception | if no name provided |


_validateParamType(string $type, $isReturn = false) : true
Validate parameter type
Parameters
Returns
Throws
Name | Type | Description |
---|---|---|
$type | string | |
$isReturn |
Type | Description |
---|---|
true |
Exception | Description |
---|---|
\Zend_Json_Server_Exception |


addParam(string | array $type, array $options = array(), int | null $order = null) : \Zend_Json_Server_Smd_Service
Add a parameter to the service
Parameters
Returns
Name | Type | Description |
---|---|---|
$type | string | array | |
$options | array | |
$order | int | null |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |


addParams(array $params) : \Zend_Json_Server_Smd_Service
Add params
Each param should be an array, and should include the key 'type'.
ParametersName | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |


getParams() : array
Get all parameters
Returns all params in specified order.
ReturnsType | Description |
---|---|
array |


setEnvelope(string $envelopeType) : \Zend_Json_Server_Smd_Service
Set envelope type
Parameters
Returns
Name | Type | Description |
---|---|---|
$envelopeType | string |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |


setName(string $name) : \Zend_Json_Server_Smd_Service
Set service name
Parameters
Returns
Throws
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |
Exception | Description |
---|---|
\Zend_Json_Server_Exception |


setOptions(array $options) : \Zend_Json_Server_Smd_Service
Set object state
Parameters
Returns
Name | Type | Description |
---|---|---|
$options | array |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |


setParams(array $params) : \Zend_Json_Server_Smd_Service
Overwrite all parameters
Parameters
Returns
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |


setReturn(string | array $type) : \Zend_Json_Server_Smd_Service
Set return type
Parameters
Returns
Name | Type | Description |
---|---|---|
$type | string | array |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |


setTarget(string $target) : \Zend_Json_Server_Smd_Service
Set service target
Parameters
Returns
Name | Type | Description |
---|---|---|
$target | string |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |


setTransport(string $transport) : \Zend_Json_Server_Smd_Service
Set Transport
Currently limited to POST
ParametersName | Type | Description |
---|---|---|
$transport | string |
Type | Description |
---|---|
\Zend_Json_Server_Smd_Service |