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 [email protected] so we can send you a copy immediately.
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Json
\Zend_Json_Server_Smd_Service
Create Service Mapping Description for a method
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Version
- $Id: Service.php 24593 2012-01-05 20:35:02Z matthew $
Properties

$_envelope = \Zend_Json_Server_Smd::ENV_JSONRPC_1
\Zend_Json_Server_Smd::ENV_JSONRPC_1Details- Type
- n/a

array $_envelopeTypes = array(\Zend_Json_Server_Smd::ENV_JSONRPC_1, \Zend_Json_Server_Smd::ENV_JSONRPC_2)Allowed envelope types
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
'/^[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
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
array('name' => 'is_string', 'optional' => 'is_bool', 'default' => null, 'description' => 'is_string')Details- Type
- array
Methods

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

_validateParamType(string $type, $isReturn = false) : trueValidate parameter type
| 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_ServiceAdd a parameter to the service
| 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_ServiceAdd params
Each param should be an array, and should include the key 'type'.
| Name | Type | Description |
|---|---|---|
| $params | array |
| Type | Description |
|---|---|
| \Zend_Json_Server_Smd_Service |

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

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

setName(string $name) : \Zend_Json_Server_Smd_ServiceSet service name
| 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_ServiceSet object state
| Name | Type | Description |
|---|---|---|
| $options | array |
| Type | Description |
|---|---|
| \Zend_Json_Server_Smd_Service |

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

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

setTarget(string $target) : \Zend_Json_Server_Smd_ServiceSet service target
| Name | Type | Description |
|---|---|---|
| $target | string |
| Type | Description |
|---|---|
| \Zend_Json_Server_Smd_Service |

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