Public Member Functions | Protected Member Functions | Protected Attributes

Zend_Json_Server_Smd_Service Class Reference

Public Member Functions

 __construct ($spec)
 setOptions (array $options)
 setName ($name)
 getName ()
 setTransport ($transport)
 getTransport ()
 setTarget ($target)
 getTarget ()
 setEnvelope ($envelopeType)
 getEnvelope ()
 addParam ($type, array $options=array(), $order=null)
 addParams (array $params)
 setParams (array $params)
 getParams ()
 setReturn ($type)
 getReturn ()
 toArray ()
 toJson ()
 __toString ()

Protected Member Functions

 _validateParamType ($type, $isReturn=false)

Protected Attributes

 $_envelope = Zend_Json_Server_Smd::ENV_JSONRPC_1
 $_name
 $_return
 $_target
 $_transport = 'POST'
 $_envelopeTypes
 $_nameRegex = '/^[a-z][a-z0-9._]+$/i'
 $_paramOptionTypes
 $_params = array()
 $_paramMap
 $_transportTypes

Detailed Description

Definition at line 35 of file Service.php.


Constructor & Destructor Documentation

__construct ( spec )

Constructor

Parameters:
string | array$spec
Returns:
void
Exceptions:
Zend_Json_Server_Exceptionif no name provided

Definition at line 124 of file Service.php.


Member Function Documentation

__toString (  )

Cast to string

Returns:
string

Definition at line 442 of file Service.php.

_validateParamType ( type,
isReturn = false 
) [protected]

Validate parameter type

Parameters:
string$type
Returns:
true
Exceptions:
Zend_Json_Server_Exception

Definition at line 454 of file Service.php.

addParam ( type,
array $  options = array(),
order = null 
)

Add a parameter to the service

Parameters:
string | array$type
array$options
int | null$order
Returns:
Zend_Json_Server_Smd_Service

Definition at line 273 of file Service.php.

addParams ( array $  params )

Add params

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

Parameters:
array$params
Returns:
Zend_Json_Server_Smd_Service

Definition at line 316 of file Service.php.

getEnvelope (  )

Get envelope type

Returns:
string

Definition at line 260 of file Service.php.

getName (  )

Retrieve name

Returns:
string

Definition at line 182 of file Service.php.

getParams (  )

Get all parameters

Returns all params in specified order.

Returns:
array

Definition at line 352 of file Service.php.

getReturn (  )

Get return type

Returns:
string|array

Definition at line 398 of file Service.php.

getTarget (  )

Get service target

Returns:
string

Definition at line 233 of file Service.php.

getTransport (  )

Get transport

Returns:
string

Definition at line 211 of file Service.php.

setEnvelope ( envelopeType )

Set envelope type

Parameters:
string$envelopeType
Returns:
Zend_Json_Server_Smd_Service

Definition at line 244 of file Service.php.

setName ( name )

Set service name

Parameters:
string$name
Returns:
Zend_Json_Server_Smd_Service
Exceptions:
Zend_Json_Server_Exception

Definition at line 166 of file Service.php.

setOptions ( array $  options )

Set object state

Parameters:
array$options
Returns:
Zend_Json_Server_Smd_Service

Definition at line 144 of file Service.php.

setParams ( array $  params )

Overwrite all parameters

Parameters:
array$params
Returns:
Zend_Json_Server_Smd_Service

Definition at line 339 of file Service.php.

setReturn ( type )

Set return type

Parameters:
string | array$type
Returns:
Zend_Json_Server_Smd_Service

Definition at line 377 of file Service.php.

setTarget ( target )

Set service target

Parameters:
string$target
Returns:
Zend_Json_Server_Smd_Service

Definition at line 222 of file Service.php.

setTransport ( transport )

Set Transport

Currently limited to POST

Parameters:
string$transport
Returns:
Zend_Json_Server_Smd_Service

Definition at line 195 of file Service.php.

toArray (  )

Cast service description to array

Returns:
array

Definition at line 408 of file Service.php.

toJson (  )

Return JSON encoding of service

Returns:
string

Definition at line 429 of file Service.php.


Field Documentation

$_envelopeTypes [protected]
Initial value:
 array(
        Zend_Json_Server_Smd::ENV_JSONRPC_1,
        Zend_Json_Server_Smd::ENV_JSONRPC_2,
    )

Definition at line 52 of file Service.php.

$_paramMap [protected]
Initial 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',
    )

Definition at line 84 of file Service.php.

$_paramOptionTypes [protected]
Initial value:
 array(
        'name'        => 'is_string',
        'optional'    => 'is_bool',
        'default'     => null,
        'description' => 'is_string',
    )

Definition at line 67 of file Service.php.

$_transportTypes [protected]
Initial value:
 array(
        'POST',
    )

Definition at line 113 of file Service.php.


The documentation for this class was generated from the following file: