Json/Server/Smd.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 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  
Subpackage
Server  
Version
$Id$  

\Zend_Json_Server_Smd

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

Constants

>VConstant  ENV_JSONRPC_1 = 'JSON-RPC-1.0'
>VConstant  ENV_JSONRPC_2 = 'JSON-RPC-2.0'
>VConstant  SMD_VERSION = '2.0'

Properties

>VPropertyprotectedstring $_contentType = 'application/json'
Content type
Default value'application/json'Details
Type
string
>VPropertyprotectedstring $_contentTypeRegex = '#[a-z]+/[a-z][a-z-]+#i'
Content type regex
Default value'#[a-z]+/[a-z][a-z-]+#i'Details
Type
string
>VPropertyprotectedstring $_description
Service description
Details
Type
string
>VPropertyprotectedbool $_dojoCompatible = false
Generate Dojo-compatible SMD
Default valuefalseDetails
Type
bool
>VPropertyprotectedstring $_envelope = self::ENV_JSONRPC_1
Current envelope
Default valueself::ENV_JSONRPC_1Details
Type
string
>VPropertyprotectedarray $_envelopeTypes = array(self::ENV_JSONRPC_1, self::ENV_JSONRPC_2)
Allowed envelope types
Default valuearray(self::ENV_JSONRPC_1, self::ENV_JSONRPC_2)Details
Type
array
>VPropertyprotectedstring $_id
Service id
Details
Type
string
>VPropertyprotectedarray $_services = array()
Services offerred
Default valuearray()Details
Type
array
>VPropertyprotectedstring $_target
Service target
Details
Type
string
>VPropertyprotectedstring $_transport = 'POST'
Global transport
Default value'POST'Details
Type
string
>VPropertyprotectedarray $_transportTypes = array('POST')
Allowed transport types
Default valuearray('POST')Details
Type
array

Methods

methodpublic__toString() : string

Cast to string (JSON)

Returns
TypeDescription
string
methodpublicaddService(\Zend_Json_Server_Smd_Service | array $service) : void

Add Service

Parameters
NameTypeDescription
$service\Zend_Json_Server_Smd_Service | array
methodpublicaddServices(array $services) : \Zend_Json_Server_Smd

Add many services

Parameters
NameTypeDescription
$servicesarray
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicgetContentType() : string

Retrieve content type

Returns
TypeDescription
string
methodpublicgetDescription() : string

Get service description

Returns
TypeDescription
string
methodpublicgetEnvelope() : string

Retrieve envelope

Returns
TypeDescription
string
methodpublicgetId() : string

Get service id

Returns
TypeDescription
string
methodpublicgetService(string $name) : false | \Zend_Json_Server_Smd_Service

Get service object

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
false | \Zend_Json_Server_Smd_Service
methodpublicgetServices() : array

Return services

Returns
TypeDescription
array
methodpublicgetTarget() : string

Retrieve service target

Returns
TypeDescription
string
methodpublicgetTransport() : string

Get transport

Returns
TypeDescription
string
methodpublicisDojoCompatible() : bool

Is this a Dojo compatible SMD?

Returns
TypeDescription
bool
methodpublicremoveService(string $name) : boolean

Remove service

Parameters
NameTypeDescription
$namestring
Returns
TypeDescription
boolean
methodpublicsetContentType(string $type) : \Zend_Json_Server_Smd

Set content type

Parameters
NameTypeDescription
$typestring
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicsetDescription(string $description) : \Zend_Json_Server_Smd

Set service description

Parameters
NameTypeDescription
$descriptionstring
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicsetDojoCompatible(bool $flag) : \Zend_Json_Server_Smd

Indicate whether or not to generate Dojo-compatible SMD

Parameters
NameTypeDescription
$flagbool
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicsetEnvelope(string $envelopeType) : \Zend_Json_Server_Smd

Set envelope

Parameters
NameTypeDescription
$envelopeTypestring
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicsetId( $id) : \Zend_Json_Server_Smd

Set service ID

Parameters
NameTypeDescription
$id
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicsetOptions(array $options) : \Zend_Json_Server_Smd

Set object state via options

Parameters
NameTypeDescription
$optionsarray
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicsetServices(array $services) : \Zend_Json_Server_Smd

Overwrite existing services with new ones

Parameters
NameTypeDescription
$servicesarray
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicsetTarget(string $target) : \Zend_Json_Server_Smd

Set service target

Parameters
NameTypeDescription
$targetstring
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublicsetTransport(string $transport) : \Zend_Json_Server_Smd

Set transport

Parameters
NameTypeDescription
$transportstring
Returns
TypeDescription
\Zend_Json_Server_Smd
methodpublictoArray() : array

Cast to array

Returns
TypeDescription
array
methodpublictoDojoArray() : array

Export to DOJO-compatible SMD array

Returns
TypeDescription
array
methodpublictoJson() : string

Cast to JSON

Returns
TypeDescription
string
Documentation was generated by phpDocumentor 2.2.0 .