Zend Framework  1.12
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Zend_Json_Server_Smd Class Reference

Public Member Functions

 setOptions (array $options)
 Set object state via options.
 
 setTransport ($transport)
 Set transport.
 
 getTransport ()
 Get transport.
 
 setEnvelope ($envelopeType)
 Set envelope.
 
 getEnvelope ()
 Retrieve envelope.
 
 setContentType ($type)
 Set content type.
 
 getContentType ()
 Retrieve content type.
 
 setTarget ($target)
 Set service target.
 
 getTarget ()
 Retrieve service target.
 
 setId ($id)
 Set service ID.
 
 getId ()
 Get service id.
 
 setDescription ($description)
 Set service description.
 
 getDescription ()
 Get service description.
 
 setDojoCompatible ($flag)
 Indicate whether or not to generate Dojo-compatible SMD.
 
 isDojoCompatible ()
 Is this a Dojo compatible SMD?
 
 addService ($service)
 Add Service.
 
 addServices (array $services)
 Add many services.
 
 setServices (array $services)
 Overwrite existing services with new ones.
 
 getService ($name)
 Get service object.
 
 getServices ()
 Return services.
 
 removeService ($name)
 Remove service.
 
 toArray ()
 Cast to array.
 
 toDojoArray ()
 Export to DOJO-compatible SMD array.
 
 toJson ()
 Cast to JSON.
 
 __toString ()
 Cast to string (JSON)
 

Public Attributes

const ENV_JSONRPC_1 = 'JSON-RPC-1.0'
 
const ENV_JSONRPC_2 = 'JSON-RPC-2.0'
 
const SMD_VERSION = '2.0'
 

Protected Attributes

 $_contentType = 'application/json'
 
 $_contentTypeRegex = '#[a-z]+/[a-z][a-z-]+#i'
 
 $_description
 
 $_dojoCompatible = false
 
 $_envelope = self::ENV_JSONRPC_1
 
 $_envelopeTypes
 
 $_id
 
 $_services = array()
 
 $_target
 
 $_transport = 'POST'
 
 $_transportTypes = array('POST')
 

Member Function Documentation

__toString ( )

Cast to string (JSON)

Returns
string
addService (   $service)

Add Service.

Parameters
Zend_Json_Server_Smd_Service | array$service
Returns
void
addServices ( array  $services)

Add many services.

Parameters
array$services
Returns
Zend_Json_Server_Smd
getContentType ( )

Retrieve content type.

Returns
string
getDescription ( )

Get service description.

Returns
string
getEnvelope ( )

Retrieve envelope.

Returns
string
getId ( )

Get service id.

Returns
string
getService (   $name)

Get service object.

Parameters
string$name
Returns
false|Zend_Json_Server_Smd_Service
getServices ( )

Return services.

Returns
array
getTarget ( )

Retrieve service target.

Returns
string
getTransport ( )

Get transport.

Returns
string
isDojoCompatible ( )

Is this a Dojo compatible SMD?

Returns
bool
removeService (   $name)

Remove service.

Parameters
string$name
Returns
boolean
setContentType (   $type)

Set content type.

Parameters
string$type
Returns
Zend_Json_Server_Smd
setDescription (   $description)

Set service description.

Parameters
string$description
Returns
Zend_Json_Server_Smd
setDojoCompatible (   $flag)

Indicate whether or not to generate Dojo-compatible SMD.

Parameters
bool$flag
Returns
Zend_Json_Server_Smd
setEnvelope (   $envelopeType)

Set envelope.

Parameters
string$envelopeType
Returns
Zend_Json_Server_Smd
setId (   $id)

Set service ID.

Parameters
string$Id
Returns
Zend_Json_Server_Smd
setOptions ( array  $options)

Set object state via options.

Parameters
array$options
Returns
Zend_Json_Server_Smd
setServices ( array  $services)

Overwrite existing services with new ones.

Parameters
array$services
Returns
Zend_Json_Server_Smd
setTarget (   $target)

Set service target.

Parameters
string$target
Returns
Zend_Json_Server_Smd
setTransport (   $transport)

Set transport.

Parameters
string$transport
Returns
Zend_Json_Server_Smd
toArray ( )

Cast to array.

Returns
array
toDojoArray ( )

Export to DOJO-compatible SMD array.

Returns
array
toJson ( )

Cast to JSON.

Returns
string

Member Data Documentation

$_contentType = 'application/json'
protected
$_contentTypeRegex = '#[a-z]+/[a-z][a-z-]+#i'
protected
$_description
protected
$_dojoCompatible = false
protected
$_envelope = self::ENV_JSONRPC_1
protected
$_envelopeTypes
protected
Initial value:
= array(
self::ENV_JSONRPC_1,
self::ENV_JSONRPC_2,
)
$_id
protected
$_services = array()
protected
$_target
protected
$_transport = 'POST'
protected
$_transportTypes = array('POST')
protected
const ENV_JSONRPC_1 = 'JSON-RPC-1.0'
const ENV_JSONRPC_2 = 'JSON-RPC-2.0'
const SMD_VERSION = '2.0'