Documentation

ParameterTrait

Description of ParameterTrait

Tags
author

zozlak

Table of Contents

Properties

$default  : string
$namespaces  : Schema
$transformations  : array<string, string>
Stores list of registered transformations
$valueProp  : NamedNodeInterface

Methods

applyTransformations()  : string
Applies given transformations to a value
getName()  : string
Returns parameter name
getValue()  : string
Return parameter value for a given repository resource
registerTransformation()  : void
Registers a new transformation
findValue()  : string
init()  : void

Properties

$transformations

Stores list of registered transformations

private static array<string, string> $transformations = ['add' => \acdhOeaw\arche\lib\disserv\dissemination\transformation\AddParam::class, 'base64' => \acdhOeaw\arche\lib\disserv\dissemination\transformation\Base64Encode::class, 'part' => \acdhOeaw\arche\lib\disserv\dissemination\transformation\UriPart::class, 'set' => \acdhOeaw\arche\lib\disserv\dissemination\transformation\SetParam::class, 'substr' => \acdhOeaw\arche\lib\disserv\dissemination\transformation\Substr::class, 'url' => \acdhOeaw\arche\lib\disserv\dissemination\transformation\UrlEncode::class, 'rawurlencode' => \acdhOeaw\arche\lib\disserv\dissemination\transformation\RawUrlEncode::class, 'removeprotocol' => \acdhOeaw\arche\lib\disserv\dissemination\transformation\RemoveProtocol::class]

Methods

applyTransformations()

Applies given transformations to a value

public static applyTransformations(string $value[, array<string|int, string> $transformations = [] ]) : string
Parameters
$value : string

value

$transformations : array<string|int, string> = []

transformations to be applied to the value

Return values
string

getName()

Returns parameter name

public getName() : string
Return values
string

getValue()

Return parameter value for a given repository resource

public getValue(RepoResourceInterface $res[, array<string|int, string> $transformations = [] ][, string|null $prefix = null ][, bool $forcePrefix = false ]) : string
Parameters
$res : RepoResourceInterface

repository resource to get the value for

$transformations : array<string|int, string> = []

transformations to be applied to the value

$prefix : string|null = null

preferred value prefix

$forcePrefix : bool = false

should error be thrown if $prefix is defined and no value with a given prefix can be found

Tags
see
transform()
Return values
string

findValue()

private findValue(DatasetNodeInterface $meta, string|null $prefix, bool $force) : string
Parameters
$meta : DatasetNodeInterface
$prefix : string|null
$force : bool
Return values
string

        
On this page

Search results