VuFind API Documentation

SpecBuilder
in package

Specification builder for record driver data formatting view helper

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$maxPos  : int
Highest position value so far.
$spec  : array<string|int, mixed>
Spec
__construct()  : mixed
Constructor
getArray()  : array<string|int, mixed>
Get the spec.
reorderKeys()  : void
Reorder the specs to match the provided array of keys.
setCombineAltLine()  : void
Construct a combine alt template spec line.
setLine()  : void
Set a generic spec line.
setMultiLine()  : void
Construct a multi-function template spec line.
setTemplateLine()  : void
Construct a record driver template spec line.

Properties

$maxPos

Highest position value so far.

protected int $maxPos = 0

$spec

Spec

protected array<string|int, mixed> $spec = []

Methods

__construct()

Constructor

public __construct([array<string|int, mixed> $spec = [] ]) : mixed
Parameters
$spec : array<string|int, mixed> = []

Existing specification lines (optional)

Return values
mixed

getArray()

Get the spec.

public getArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

reorderKeys()

Reorder the specs to match the provided array of keys.

public reorderKeys(array<string|int, mixed> $orderedKeys[, int $defaultPos = null ]) : void
Parameters
$orderedKeys : array<string|int, mixed>

Keys in the desired order

$defaultPos : int = null

Position to use for elements not included in $orderedKeys (null to put unrecognized items at end of list).

Return values
void

setCombineAltLine()

Construct a combine alt template spec line.

public setCombineAltLine(string $key, string $dataMethod[, array<string|int, mixed> $options = [] ]) : void
Parameters
$key : string

Label to associate with this spec line

$dataMethod : string

Method of data retrieval for rendering element

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

Additional options

Return values
void

setLine()

Set a generic spec line.

public setLine(string $key, string $dataMethod[, string $renderType = null ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$key : string

Label to associate with this spec line

$dataMethod : string

Method of data retrieval for rendering element

$renderType : string = null

Type of rendering to use to generate output

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

Additional options

Return values
void

setMultiLine()

Construct a multi-function template spec line.

public setMultiLine(string $key, string $dataMethod, callable $callback[, array<string|int, mixed> $options = [] ]) : void
Parameters
$key : string

Label to associate with this spec line

$dataMethod : string

Method of data retrieval for rendering element

$callback : callable

Callback function for multi-processing

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

Additional options

Return values
void

setTemplateLine()

Construct a record driver template spec line.

public setTemplateLine(string $key, string $dataMethod, string $template[, array<string|int, mixed> $options = [] ]) : void
Parameters
$key : string

Label to associate with this spec line

$dataMethod : string

Method of data retrieval for rendering element

$template : string

Record driver template to render with data

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

Additional options

Return values
void

Search results