VuFind API Documentation

Loader
in package
implements LoggerAwareInterface Uses LoggerAwareTrait

Record loader

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

author

Ere Maijala ere.maijala@helsinki.fi

license

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

link

Main Site

Interfaces, Classes, Traits and Enums

LoggerAwareInterface

Table of Contents

$fallbackLoader  : PluginManager
Fallback record loader
$recordCache  : Cache
Record cache
$recordFactory  : PluginManager
Record factory
$searchService  : Service
Search service
__construct()  : mixed
Constructor
load()  : AbstractBase
Given an ID and record source, load the requested record object.
loadBatch()  : array<string|int, mixed>
Given an array of associative arrays with id and source keys (or pipe- separated source|id strings), load all of the requested records in the requested order.
loadBatchForSource()  : array<string|int, mixed>
Given an array of IDs and a record source, load a batch of records for that source.
setCacheContext()  : void
Set the context to control cache behavior
buildMissingRecord()  : Missing
Build a "missing record" driver.
debug()  : void
Log a debug message.
log()  : void
Send a message to the logger.
logError()  : void
Log an error message.
logWarning()  : void
Log a warning message.

Properties

Methods

load()

Given an ID and record source, load the requested record object.

public load(string $id[, string $source = DEFAULT_SEARCH_BACKEND ][, bool $tolerateMissing = false ][, ParamBag $params = null ]) : AbstractBase
Parameters
$id : string

Record ID

$source : string = DEFAULT_SEARCH_BACKEND

Record source

$tolerateMissing : bool = false

Should we load a "Missing" placeholder instead of throwing an exception if the record cannot be found?

$params : ParamBag = null

Search backend parameters

Tags
throws
Exception
Return values
AbstractBase

loadBatch()

Given an array of associative arrays with id and source keys (or pipe- separated source|id strings), load all of the requested records in the requested order.

public loadBatch(array<string|int, mixed> $ids[, bool $tolerateBackendExceptions = false ][, array<string|int, ParamBag$params = [] ]) : array<string|int, mixed>
Parameters
$ids : array<string|int, mixed>

Array of associative arrays with id/source keys or strings in source|id format. In associative array formats, there is also an optional "extra_fields" key which can be used to pass in data formatted as if it belongs to the Solr schema; this is used to create a mock driver object if the real data source is unavailable.

$tolerateBackendExceptions : bool = false

Whether to tolerate backend exceptions that may be caused by e.g. connection issues or changes in subscriptions

$params : array<string|int, ParamBag> = []

Associative array of search backend parameters keyed with source key

Tags
throws
Exception
Return values
array<string|int, mixed>

Array of record drivers

loadBatchForSource()

Given an array of IDs and a record source, load a batch of records for that source.

public loadBatchForSource(array<string|int, mixed> $ids[, string $source = DEFAULT_SEARCH_BACKEND ][, bool $tolerateBackendExceptions = false ][, ParamBag $params = null ]) : array<string|int, mixed>
Parameters
$ids : array<string|int, mixed>

Record IDs

$source : string = DEFAULT_SEARCH_BACKEND

Record source

$tolerateBackendExceptions : bool = false

Whether to tolerate backend exceptions that may be caused by e.g. connection issues or changes in subscriptions

$params : ParamBag = null

Search backend parameters

Tags
throws
Exception
Return values
array<string|int, mixed>

setCacheContext()

Set the context to control cache behavior

public setCacheContext(string $context) : void
Parameters
$context : string

Cache context

Return values
void

buildMissingRecord()

Build a "missing record" driver.

protected buildMissingRecord(array<string|int, mixed> $details) : Missing
Parameters
$details : array<string|int, mixed>

Associative array of record details (from a SourceAndIdList)

Return values
Missing

debug()

Log a debug message.

protected debug(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

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

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

log()

Send a message to the logger.

protected log(string $level, string $message[, array<string|int, mixed> $context = [] ][, bool $prependClass = false ]) : void
Parameters
$level : string

Log level

$message : string

Log message

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

Log context

$prependClass : bool = false

Prepend class name to message?

Return values
void

logError()

Log an error message.

protected logError(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

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

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

logWarning()

Log a warning message.

protected logWarning(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

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

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

Search results