ServiceTrait
Description of ServiceTrait
Tags
Table of Contents
Properties
- $loadParamFromMeta : bool
- $param : array<string|int, mixed>
- Parameters list
Methods
- getFormats() : array<string|int, Format>
- Returns all return formats provided by the dissemination service.
- getLocation() : string
- Gets disseminations service's URL (before parameters subsitution)
- getMatchingResources() : Generator
- Returns repository resources which can be disseminated by a given service
- getMatchQuery() : QueryPart
- Returns an SQL query matching dissemination services and resources (in any direction).
- getParameters() : array<string|int, mixed>
- Get the parameters
- getRequest() : Request
- Returns PSR-7 HTTP request disseminating a given resource.
- getRevProxy() : bool
- Should the dissemination service request be reverse-proxied?
- loadParametersFromMetadata() : void
- Tells the service it can load information on service parameters from its metadata.
- getParameterClass() : string
- getParameterValues() : array<string, mixed>
- Evaluates parameter values for a given resource.
- getResNmspId() : string
- Fetches a resource id in a given namespace.
- getUrlParameters() : array<string|int, string>
- Returns list of all parameters of a given dissemination service
- loadParameters() : void
Properties
$loadParamFromMeta
private
bool
$loadParamFromMeta
= false
$param
Parameters list
private
array<string|int, mixed>
$param
Methods
getFormats()
Returns all return formats provided by the dissemination service.
public
getFormats() : array<string|int, Format>
Technically return formats are nothing more then strings. There is no requirement forcing them to be mime types, etc.
Return values
array<string|int, Format>getLocation()
Gets disseminations service's URL (before parameters subsitution)
public
getLocation() : string
Return values
stringgetMatchingResources()
Returns repository resources which can be disseminated by a given service
public
getMatchingResources([int|null $limit = null ][, int|null $offset = null ]) : Generator
Parameters
- $limit : int|null = null
- $offset : int|null = null
Return values
GeneratorgetMatchQuery()
Returns an SQL query matching dissemination services and resources (in any direction).
public
static getMatchQuery(int $id, int $mode, Schema $schema) : QueryPart
Parameters
- $id : int
-
resource or dissemination service id
- $mode : int
-
one of:
- ServiceInterface::QUERY_RES for querying resources for a given dissemination service
- ServiceInterface::QUERY_DISSERV for querying dissemination services for a given resource
- $schema : Schema
-
schema object providing RDF property mappings
Return values
QueryPartgetParameters()
Get the parameters
public
getParameters() : array<string|int, mixed>
Return values
array<string|int, mixed>getRequest()
Returns PSR-7 HTTP request disseminating a given resource.
public
getRequest(RepoResourceInterface $res) : Request
Parameters
- $res : RepoResourceInterface
-
repository resource to be disseminated
Tags
Return values
RequestgetRevProxy()
Should the dissemination service request be reverse-proxied?
public
getRevProxy() : bool
If it's not set in the metadata, false is assumed.
Return values
boolloadParametersFromMetadata()
Tells the service it can load information on service parameters from its metadata.
public
loadParametersFromMetadata() : void
Information will be loaded in a lazy way (when it's needed).
getParameterClass()
private
abstract getParameterClass() : string
Return values
stringgetParameterValues()
Evaluates parameter values for a given resource.
private
getParameterValues(array<string|int, string> $param, RepoResourceInterface $res) : array<string, mixed>
Parameters
- $param : array<string|int, string>
-
list of parameters
- $res : RepoResourceInterface
-
repository resource to be disseminated
Tags
Return values
array<string, mixed> —associative array with parameter values
getResNmspId()
Fetches a resource id in a given namespace.
private
getResNmspId(RepoResourceInterface $res, string $namespace, bool $force) : string
If namespaces overlap, tries to to avoid id in the overlapping ones.
Parameters
- $res : RepoResourceInterface
- $namespace : string
- $force : bool
Tags
Return values
stringgetUrlParameters()
Returns list of all parameters of a given dissemination service
private
getUrlParameters() : array<string|int, string>
Return values
array<string|int, string>loadParameters()
private
loadParameters() : void