VuFind API Documentation

RecordCollection extends AbstractRecordCollection
in package

Pazpar2 record collection.

Tags
category

VuFind

author

David Maus maus@hab.de

license

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

link
https://vufind.org

Table of Contents

$offset  : int
Zero-based offset in complete search result.
$pointer  : int
Array pointer
$records  : array<string|int, mixed>
Response records.
$response  : array<string|int, mixed>
Raw response.
$source  : string
Source identifier
$total  : int
Total records
__construct()  : void
Constructor.
add()  : void
Add a record to the collection.
count()  : int
Return number of records in collection.
current()  : RecordInterface
Return record at current collection index.
first()  : RecordInterface|null
Return first record in response.
getErrors()  : array<string|int, mixed>
Return any errors.
getFacets()  : array<string|int, mixed>
Return facet information.
getOffset()  : int
Return offset in the total search result set.
getRecords()  : array<string|int, mixed>
Return records.
getSourceIdentifier()  : string
Return the source backend identifier.
getTotal()  : int
Return total number of records found.
has()  : bool
Check if the collection contains the given record
key()  : int
Return current collection index.
next()  : void
Move to next collection index.
replace()  : void
Replace a record in the collection.
rewind()  : void
Rewind collection index.
setSourceIdentifier()  : void
Set the source backend identifier.
setSourceIdentifiers()  : void
Set the source backend identifiers.
shuffle()  : bool
Shuffles records.
slice()  : void
Slice the record list.
valid()  : bool
Return true if current collection index is valid.

Properties

Methods

__construct()

Constructor.

public __construct(int $total, int $offset) : void
Parameters
$total : int

Total result count

$offset : int

Search offset

Return values
void

add()

Add a record to the collection.

public add(RecordInterface $record[, bool $checkExisting = true ]) : void
Parameters
$record : RecordInterface

Record to add

$checkExisting : bool = true

Whether to check for existing record in the collection (slower, but makes sure there are no duplicates)

Return values
void

getErrors()

Return any errors.

public getErrors() : array<string|int, mixed>

Each error can be a translatable string or an array that the Flashmessages view helper understands.

Return values
array<string|int, mixed>

getFacets()

Return facet information.

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

getOffset()

Return offset in the total search result set.

public getOffset() : int
Return values
int

getRecords()

Return records.

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

getSourceIdentifier()

Return the source backend identifier.

public getSourceIdentifier() : string
Return values
string

getTotal()

Return total number of records found.

public getTotal() : int
Return values
int

setSourceIdentifier()

Set the source backend identifier.

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

Backend 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

slice()

Slice the record list.

public slice(int $offset, int $limit) : void
Parameters
$offset : int

Offset

$limit : int

Limit

Return values
void

Search results