VuFind API Documentation

SimpleRecord
in package
implements RecordInterface Uses RecordTrait

A minimal record class for wrapping an array of fields

Tags
category

VuFind

author

Ere Maijala ere.maijala@helsinki.fi

license

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

link

Main Page

Interfaces, Classes, Traits and Enums

RecordInterface
Record interface.

Table of Contents

$fields  : array<string|int, mixed>
Field data
$labels  : array<string|int, mixed>
Labels for the record
$searchBackendIdentifier  : string
Used for identifying the search backend used to find the record
$sourceIdentifier  : string
Used for identifying record source backend
__construct()  : mixed
Constructor
addLabel()  : void
Add a label for the record
get()  : mixed
Get field contents.
getLabels()  : array<string|int, mixed>
Return all labels for the record
getSearchBackendIdentifier()  : string
Return the search backend identifier used to find the record.
getSourceIdentifier()  : string
Return the source backend identifier.
setLabels()  : void
Set the labels for the record
setSourceIdentifier()  : void
Set the record source backend identifier.
setSourceIdentifiers()  : void
Set the source backend identifiers.

Properties

$fields

Field data

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

$labels

Labels for the record

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

$searchBackendIdentifier

Used for identifying the search backend used to find the record

protected string $searchBackendIdentifier = ''

$sourceIdentifier

Used for identifying record source backend

protected string $sourceIdentifier = ''

Methods

__construct()

Constructor

public __construct(array<string|int, mixed> $fields) : mixed
Parameters
$fields : array<string|int, mixed>

Raw data

Return values
mixed

addLabel()

Add a label for the record

public addLabel(string $label, string $class) : void
Parameters
$label : string

Label, may be a translation key

$class : string

Label class

Return values
void

get()

Get field contents.

public get(string $field) : mixed
Parameters
$field : string

Field to get

Return values
mixed

getLabels()

Return all labels for the record

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

An array of associative arrays with keys 'label' and 'class'

getSearchBackendIdentifier()

Return the search backend identifier used to find the record.

public getSearchBackendIdentifier() : string
Return values
string

getSourceIdentifier()

Return the source backend identifier.

public getSourceIdentifier() : string
Return values
string

setLabels()

Set the labels for the record

public setLabels(array<string|int, mixed> $labels) : void
Parameters
$labels : array<string|int, mixed>

An array of associative arrays with keys 'label' and 'class'

Return values
void

setSourceIdentifier()

Set the record source backend identifier.

public setSourceIdentifier(string $identifier) : void
Parameters
$identifier : string

Record source identifier

Tags
deprecated

Use setSourceIdentifiers instead

Return values
void

setSourceIdentifiers()

Set the source backend identifiers.

public setSourceIdentifiers(string $recordSourceId[, string $searchBackendId = '' ]) : void
Parameters
$recordSourceId : string

Record source identifier

$searchBackendId : string = ''

Search backend identifier (if different from $recordSourceId)

Return values
void

Search results