ParameterTrait
Description of ParameterTrait
Tags
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
$default
private
string
$default
= ''
$namespaces
private
Schema
$namespaces
$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]
$valueProp
private
NamedNodeInterface
$valueProp
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
stringgetName()
Returns parameter name
public
getName() : string
Return values
stringgetValue()
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
Return values
stringregisterTransformation()
Registers a new transformation
public
static registerTransformation(iTransformation $transformation) : void
Parameters
- $transformation : iTransformation
-
transformation to be registered
findValue()
private
findValue(DatasetNodeInterface $meta, string|null $prefix, bool $force) : string
Parameters
- $meta : DatasetNodeInterface
- $prefix : string|null
- $force : bool
Return values
stringinit()
private
init() : void