EndpointFactory
in package
Table of Contents
Properties
- $diFactory : FactoryInterface
- $restConfig : RestConfig
Methods
- __construct() : mixed
- create() : Endpoint
- Create
- getAuthToken() : string|null
- Get auth token.
- getCommandParams() : array<string|int, mixed>
- Get Command Params
- getAuthBearerToken() : string|null
- Get auth bearer token.
- getEndpointConfig() : array<string|int, mixed>
- Get Endpoint Config
- getParams() : array<string|int, mixed>
- Get Query Params
- parseEndpointConfig() : array<string|int, mixed>
- Parse Endpoint Config
Properties
$diFactory
protected
FactoryInterface
$diFactory
$restConfig
protected
RestConfig
$restConfig
Methods
__construct()
public
__construct(FactoryInterface $diFactory, RestConfig $restConfig) : mixed
Parameters
- $diFactory : FactoryInterface
- $restConfig : RestConfig
create()
Create
public
create(CHttpRequest $request) : Endpoint
Parameters
- $request : CHttpRequest
Return values
EndpointgetAuthToken()
Get auth token.
public
getAuthToken() : string|null
Attempts to read from 'authToken' GET parameter and falls back to authorisation bearer token.
Return values
string|nullgetCommandParams()
Get Command Params
public
getCommandParams(array<string|int, mixed> $endpoint, CHttpRequest $request) : array<string|int, mixed>
Parse REST API command params from HTTP request.
Parameters
- $endpoint : array<string|int, mixed>
- $request : CHttpRequest
Return values
array<string|int, mixed>getAuthBearerToken()
Get auth bearer token.
protected
getAuthBearerToken() : string|null
Attempts to read bearer token from authorisation header.
Return values
string|nullgetEndpointConfig()
Get Endpoint Config
protected
getEndpointConfig(CHttpRequest $request) : array<string|int, mixed>
Parameters
- $request : CHttpRequest
Tags
Return values
array<string|int, mixed>getParams()
Get Query Params
protected
getParams(array<string|int, mixed> $endpoint, CHttpRequest $request) : array<string|int, mixed>
Parse REST config params from the HTTP request.
Parameters
- $endpoint : array<string|int, mixed>
- $request : CHttpRequest
Return values
array<string|int, mixed>parseEndpointConfig()
Parse Endpoint Config
protected
parseEndpointConfig(CHttpRequest $request) : array<string|int, mixed>
Parameters
- $request : CHttpRequest