Create Service Mapping Description for a method

todo Revised method regex to allow NS; however, should SMD be revised to strip PHP NS instead when attaching functions?

 Methods

Constructor

__construct(string | array $spec) 

Parameters

$spec

stringarray

Exceptions

\Zend\Json\Server\Exception\InvalidArgumentException if no name provided

Cast to string

__toString() : string

Returns

string

Add a parameter to the service

addParam(string | array $type, array $options, int | null $order) : \Zend\Json\Server\Smd\Service

Parameters

$type

stringarray

$options

array

$order

intnull

Exceptions

\Zend\Json\Server\Exception\InvalidArgumentException

Returns

Add params

addParams(array $params) : \Zend\Json\Server\Smd\Service

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

Parameters

$params

array

Returns

Get envelope type

getEnvelope() : string

Returns

string

Retrieve name

getName() : string

Returns

string

Get all parameters

getParams() : array

Returns all params in specified order.

Returns

array

Get return type

getReturn() : string | array

Returns

stringarray

Get service target

getTarget() : string

Returns

string

Get transport

getTransport() : string

Returns

string

Set envelope type

setEnvelope(string $envelopeType) : \Zend\Json\Server\Smd\Service

Parameters

$envelopeType

string

Exceptions

\Zend\Json\Server\Exception\InvalidArgumentException

Returns

Set service name

setName(string $name) : \Zend\Json\Server\Smd\Service

Set object state

setOptions(array $options) : \Zend\Json\Server\Smd\Service

Parameters

$options

array

Returns

Overwrite all parameters

setParams(array $params) : \Zend\Json\Server\Smd\Service

Parameters

$params

array

Returns

Set return type

setReturn(string | array $type) : \Zend\Json\Server\Smd\Service

Set service target

setTarget(string $target) : \Zend\Json\Server\Smd\Service

Parameters

$target

string

Returns

Set Transport

setTransport(string $transport) : \Zend\Json\Server\Smd\Service

Currently limited to POST

Parameters

$transport

string

Exceptions

\Zend\Json\Server\Exception\InvalidArgumentException

Returns

Cast service description to array

toArray() : array

Returns

array

Return JSON encoding of service

toJson() : string

Returns

string

Validate parameter type

_validateParamType(string $type, bool $isReturn) : string

Parameters

$type

string

$isReturn

bool

Exceptions

\Zend\Json\Server\Exception\InvalidArgumentException

Returns

string

 Properties

 

$envelope

$envelope 

 

Allowed envelope types

$envelopeTypes : array

 

$name

$name 

 

Regex for names

$nameRegex : string

 

Mapping of parameter types to JSON-RPC types

$paramMap : array

 

Parameter option types

$paramOptionTypes : array

 

Service params

$params : array

 

$return

$return 

 

$target

$target 

 

$transport

$transport 

 

Allowed transport types

$transportTypes : array