API Documentation

Zend/Json/Server/Smd/Service.php

Show: inherited
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 license@zend.com 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

Package: Zend\Json\Server

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 24594 2012-01-05 21:27:01Z matthew $  

Properties

Propertyprotected  $_envelope= 'Zend_Json_Server_Smd::ENV_JSONRPC_1'
Default valueZend_Json_Server_Smd::ENV_JSONRPC_1Details
Type
Propertyprotectedarray  $_envelopeTypes= 'array( Zend_Json_Server_Smd::ENV_JSONRPC_1'

Allowed envelope types

Default valuearray( Zend_Json_Server_Smd::ENV_JSONRPC_1Details
Type
array
Propertyprotected  $_name= ''
Details
Type
Propertyprotectedstring  $_nameRegex= ''/^[a-z][a-z0-9._]+$/i''

Regex for names

Default value'/^[a-z][a-z0-9._]+$/i'Details
Type
string
Propertyprotectedarray  $_paramMap= 'array( 'any' => 'any''

Mapping of parameter types to JSON-RPC types

Default valuearray( 'any' => 'any'Details
Type
array
Propertyprotectedarray  $_paramOptionTypes= 'array( 'name' => 'is_string''

Parameter option types

Default valuearray( 'name' => 'is_string'Details
Type
array
Propertyprotectedarray  $_params= 'array()'

Service params

Default valuearray()Details
Type
array
Propertyprotected  $_return= ''
Details
Type
Propertyprotected  $_target= ''
Details
Type
Propertyprotected  $_transport= ''POST''
Default value'POST'Details
Type
Propertyprotectedarray  $_transportTypes= 'array( 'POST''

Allowed transport types

Default valuearray( 'POST'Details
Type
array

Methods

methodpublic__construct( string|array $spec ) : void

Constructor

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

Cast to string

Returns
Type Description
string
methodprotected_validateParamType( string $type,  $isReturn = false ) : true

Validate parameter type

Parameters
Name Type Description
$type string
$isReturn
Returns
Type Description
true
Throws
Exception Description
\Zend_Json_Server_Exception
methodpublicaddParam( string|array $type, array $options = array(), int|null $order = null ) : \Zend_Json_Server_Smd_Service

Add a parameter to the service

Parameters
Name Type Description
$type string|array
$options array
$order int|null
Returns
Type Description
\Zend_Json_Server_Smd_Service
methodpublicaddParams( array $params ) : \Zend_Json_Server_Smd_Service

Add params

Each param should be an array, and should include the key 'type'.

Parameters
Name Type Description
$params array
Returns
Type Description
\Zend_Json_Server_Smd_Service
methodpublicgetEnvelope( ) : string

Get envelope type

Returns
Type Description
string
methodpublicgetName( ) : string

Retrieve name

Returns
Type Description
string
methodpublicgetParams( ) : array

Get all parameters

Returns all params in specified order.

Returns
Type Description
array
methodpublicgetReturn( ) : string|array

Get return type

Returns
Type Description
string|array
methodpublicgetTarget( ) : string

Get service target

Returns
Type Description
string
methodpublicgetTransport( ) : string

Get transport

Returns
Type Description
string
methodpublicsetEnvelope( string $envelopeType ) : \Zend_Json_Server_Smd_Service

Set envelope type

Parameters
Name Type Description
$envelopeType string
Returns
Type Description
\Zend_Json_Server_Smd_Service
methodpublicsetName( string $name ) : \Zend_Json_Server_Smd_Service

Set service name

Parameters
Name Type Description
$name string
Returns
Type Description
\Zend_Json_Server_Smd_Service
Throws
Exception Description
\Zend_Json_Server_Exception
methodpublicsetOptions( array $options ) : \Zend_Json_Server_Smd_Service

Set object state

Parameters
Name Type Description
$options array
Returns
Type Description
\Zend_Json_Server_Smd_Service
methodpublicsetParams( array $params ) : \Zend_Json_Server_Smd_Service

Overwrite all parameters

Parameters
Name Type Description
$params array
Returns
Type Description
\Zend_Json_Server_Smd_Service
methodpublicsetReturn( string|array $type ) : \Zend_Json_Server_Smd_Service

Set return type

Parameters
Name Type Description
$type string|array
Returns
Type Description
\Zend_Json_Server_Smd_Service
methodpublicsetTarget( string $target ) : \Zend_Json_Server_Smd_Service

Set service target

Parameters
Name Type Description
$target string
Returns
Type Description
\Zend_Json_Server_Smd_Service
methodpublicsetTransport( string $transport ) : \Zend_Json_Server_Smd_Service

Set Transport

Currently limited to POST

Parameters
Name Type Description
$transport string
Returns
Type Description
\Zend_Json_Server_Smd_Service
methodpublictoArray( ) : array

Cast service description to array

Returns
Type Description
array
methodpublictoJson( ) : string

Return JSON encoding of service

Returns
Type Description
string
Documentation was generated by DocBlox 0.15.1.