Zend\Json\Server\Smd\Service
Create Service Mapping Description for a method
Synopsis
class Service
{
- // members
- protected $envelope;
- protected $name;
- protected $return;
- protected $target;
- protected string $transport;
- protected array $envelopeTypes;
- protected string $nameRegex;
- protected array $paramOptionTypes;
- protected array $params;
- protected array $paramMap;
- protected array $transportTypes;
- // methods
- public void __construct()
- public Service setOptions()
- public Service setName()
- public string getName()
- public Service setTransport()
- public string getTransport()
- public Service setTarget()
- public string getTarget()
- public Service setEnvelope()
- public string getEnvelope()
- public Service addParam()
- public Service addParams()
- public Service setParams()
- public array getParams()
- public Service setReturn()
- public string|array getReturn()
- public array toArray()
- public string toJson()
- public string __toString()
- protected string _validateParamType()
Tasks
Line | Task |
---|---|
20+ | Revised method regex to allow NS; however, should SMD be revised to strip PHP NS instead when attaching functions? |
Members
protected
- $envelope
- $envelopeTypes
—
array
Allowed envelope types - $name
- $nameRegex
—
string
Regex for names - $paramMap
—
array
Mapping of parameter types to JSON-RPC types - $paramOptionTypes
—
array
Parameter option types - $params
—
array
Service params - $return
- $target
- $transport
- $transportTypes
—
array
Allowed transport types
Methods
protected
- _validateParamType() — Validate parameter type
public
- __construct() — Constructor
- __toString() — Cast to string
- addParam() — Add a parameter to the service
- addParams() — Add params
- getEnvelope() — Get envelope type
- getName() — Retrieve name
- getParams() — Get all parameters
- getReturn() — Get return type
- getTarget() — Get service target
- getTransport() — Get transport
- setEnvelope() — Set envelope type
- setName() — Set service name
- setOptions() — Set object state
- setParams() — Overwrite all parameters
- setReturn() — Set return type
- setTarget() — Set service target
- setTransport() — Set Transport
- toArray() — Cast service description to array
- toJson() — Return JSON encoding of service