VuFind API Documentation

RecordCollection extends AbstractRecordCollection
in package

WorldCat 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
__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.
getBestBets()  : array<string|int, mixed>|bool
Get best bets from Summon, if any.
getDatabaseRecommendations()  : array<string|int, mixed>|bool
Get database recommendations from Summon, if any.
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.
getSpellcheck()  : array<string|int, mixed>
Get spelling suggestions.
getTopicRecommendations()  : array<string|int, mixed>|bool
Get topic recommendations from Summon, if any.
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(array<string|int, mixed> $response) : void
Parameters
$response : array<string|int, mixed>

Summon response

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

getBestBets()

Get best bets from Summon, if any.

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

false if no recommendations, detailed array otherwise.

getDatabaseRecommendations()

Get database recommendations from Summon, if any.

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

false if no recommendations, detailed array otherwise.

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

getSpellcheck()

Get spelling suggestions.

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

getTopicRecommendations()

Get topic recommendations from Summon, if any.

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

false if no recommendations, detailed array otherwise.

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