Documentation

RepoTrait

A common (mostly boiler plate) code for classes implementing the RepoInterface.

Tags
author

zozlak

Table of Contents

Properties

$headers  : object
An object providing mappings of repository REST API parameters to HTTP headers used by a given repository instance.
$queryLog  : AbstractLogger|null
$schema  : Schema
An object providing mappings of repository concepts to RDF properties used to denote them by a given repository instance.

Methods

getHeaderName()  : string
Returns an HTTP header name to be used to pass a given information in the repository request.
getResourceById()  : RepoResourceInterface
Tries to find a repository resource with a given id.
getSchema()  : Schema
Returns the `Schema` object defining repository entities to RDF property mappings.
setQueryLog()  : void
Sets a search queries logger
extractResourcesFromGraph()  : Generator<string|int, RepoResourceInterface>
Extracts collection of RepoResource objects from the EasyRdf graph being parsed from a search response.
sortMatchingResources()  : void

Properties

$headers

An object providing mappings of repository REST API parameters to HTTP headers used by a given repository instance.

private object $headers

$queryLog

private AbstractLogger|null $queryLog

$schema

An object providing mappings of repository concepts to RDF properties used to denote them by a given repository instance.

private Schema $schema

Methods

getHeaderName()

Returns an HTTP header name to be used to pass a given information in the repository request.

public getHeaderName(string $purpose) : string
Parameters
$purpose : string
Return values
string

getSchema()

Returns the `Schema` object defining repository entities to RDF property mappings.

public getSchema() : Schema
Return values
Schema

setQueryLog()

Sets a search queries logger

public setQueryLog(AbstractLogger $log) : void
Parameters
$log : AbstractLogger

extractResourcesFromGraph()

Extracts collection of RepoResource objects from the EasyRdf graph being parsed from a search response.

private extractResourcesFromGraph(Dataset $graph, SearchConfig $config) : Generator<string|int, RepoResourceInterface>
Parameters
$graph : Dataset

graph returned by the parseSearchResponse() method

$config : SearchConfig

search configuration object

Return values
Generator<string|int, RepoResourceInterface>

sortMatchingResources()

private sortMatchingResources(array<string|int, DatasetNodeInterface&$resources, NamedNode $searchOrderProp) : void
Parameters
$resources : array<string|int, DatasetNodeInterface>
$searchOrderProp : NamedNode

        
On this page

Search results