VuFind API Documentation

Voyager2Mock extends Voyager
in package
Uses ILSMockTrait

Support class (secondary mock Voyager driver) for MultiBackend ILS driver test

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

Table of Contents

$config  : array<string|int, mixed>
Driver configuration
$dateFormat  : Converter
Date formatting object
$dbName  : string
Name of database
$displayDueTimeIntervals  : array<string|int, mixed>
Loan interval types for which to display the due time (empty = all)
$lazyDb  : Oci8
Lazily instantiated database connection. Use getDb() to access it.
$statusRankings  : array<string|int, mixed>|bool
Stored status rankings from the database; initialized to false but populated by the pickStatus() method.
$translator  : TranslatorInterface
Translator
$useHoldingsSortGroups  : bool
Whether to use holdings sort groups to sort holdings records
__construct()  : mixed
Constructor
cancelHolds()  : array<string|int, mixed>
Cancel hold requests.
cancelILLRequests()  : array<string|int, mixed>
Cancel ILL Request
cancelStorageRetrievalRequests()  : array<string|int, mixed>
Cancel Storage Retrieval Request
checkILLRequestIsValid()  : mixed
Check if ILL request available
checkRequestIsValid()  : mixed
Check if hold or recall available
checkStorageRetrievalRequestIsValid()  : mixed
Check if storage retrieval request available
findReserves()  : array<string|int, mixed>
Find Reserves
getAccountBlocks()  : mixed
Check whether the patron has any blocks on their account.
getCancelHoldDetails()  : string
Get Cancel Hold Request Details
getCancelILLRequestDetails()  : string
Get Cancel ILL Request Details
getCancelStorageRetrievalRequestDetails()  : string
Get Cancel Storage Retrieval Request Details
getConfig()  : array<string|int, mixed>
Public Function which specifies renew, hold and cancel settings.
getCourses()  : array<string|int, mixed>
Get Courses
getDefaultPickUpLocation()  : false|string
Get Default Pick Up Location
getDefaultRequestGroup()  : false|string
Get Default Request Group
getDepartments()  : array<string|int, mixed>
Get Departments
getFunds()  : array<string|int, mixed>
Get Funds
getHolding()  : array<string|int, mixed>
Get Holding
getHoldLink()  : string
Get Hold Link
getILLPickUpLibraries()  : bool|array<string|int, mixed>
Get ILL Pickup Libraries
getILLPickUpLocations()  : bool|array<string|int, mixed>
Get ILL Pickup Locations
getInstructors()  : array<string|int, mixed>
Get Instructors
getMyFines()  : mixed
Get Patron Fines
getMyHolds()  : array<string|int, mixed>
Get Patron Holds
getMyILLRequests()  : mixed
Get Patron ILL Requests
getMyProfile()  : array<string|int, mixed>
Get Patron Profile
getMyStorageRetrievalRequests()  : array<string|int, mixed>
Get Patron Storage Retrieval Requests
getMyTransactions()  : array<string|int, mixed>
Get Patron Transactions
getNewItems()  : array<string|int, mixed>
Get New Items
getPickUpLocations()  : array<string|int, mixed>
Get Pick Up Locations
getPurchaseHistory()  : array<string|int, mixed>
Get Purchase History
getRecentlyReturnedBibs()  : array<string|int, mixed>
Get bib records for recently returned items.
getRenewDetails()  : string
Get Renew Details
getRequestBlocks()  : mixed
Check whether the patron is blocked from placing requests (holds/ILL/SRR).
getRequestGroups()  : array<string|int, mixed>
Get request groups
getStatus()  : mixed
Get Status
getStatuses()  : array<string|int, mixed>
Get Statuses
getSuppressedRecords()  : array<string|int, mixed>
Get suppressed records.
getTranslator()  : TranslatorInterface
Get translator object.
getTranslatorLocale()  : string
Get the locale from the translator.
getTrendingBibs()  : array<string|int, mixed>
Get bib records for "trending" items (recently returned with high usage).
init()  : void
Initialize the driver.
loginIsHidden()  : bool
Is login disabled?
patronLogin()  : mixed
Patron Login
placeHold()  : mixed
Place Hold
placeILLRequest()  : mixed
Place ILL Request
placeStorageRetrievalRequest()  : mixed
Place a Storage Retrieval Request
renewMyItems()  : array<string|int, mixed>
Renew My Items
setConfig()  : void
Set configuration.
setTranslator()  : TranslatorAwareInterface
Set a translator
translate()  : string
Translate a string (or string-castable object)
translateWithPrefix()  : string
Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.
buildSqlFromArray()  : array<string|int, mixed>
Protected support method for building sql strings.
debug()  : void
Log a debug message.
debugSQL()  : void
Log an SQL statement debug message.
determineAvailability()  : array<string|int, mixed>
Protected support method to take an array of status strings and determine whether or not this indicates an available item. Returns an array with two keys: 'available', the boolean availability status, and 'otherStatuses', every status code found other than "Not Charged" - for use with pickStatus().
executeSQL()  : PDOStatement
Execute an SQL query
extractTextDomain()  : array<string|int, mixed>
Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.
getDb()  : PDO
Initialize database connection if necessary and return it.
getDebugTranslation()  : string
Build a debug-mode translation
getFineSQL()  : array<string|int, mixed>
Protected support method for getMyFines.
getHoldingData()  : array<string|int, mixed>
Protected support method for getHolding.
getHoldingItemsSQL()  : array<string|int, mixed>
Protected support method for getHolding.
getHoldingNoItemsSQL()  : array<string|int, mixed>
Protected support method for getHolding.
getItemSortSequenceSQL()  : string
Helper function that returns SQL for getting a sort sequence for a location
getLocationName()  : string
Look up a location name by ID.
getMFHDData()  : string|array<string|int, mixed>
Get specified fields from an MFHD MARC Record
getMyHoldsSQL()  : array<string|int, mixed>
Protected support method for getMyHolds.
getMyStorageRetrievalRequestsSQL()  : array<string|int, mixed>
Protected support method for getMyStorageRetrievalRequests.
getMyTransactionsSQL()  : array<string|int, mixed>
Protected support method for getMyTransactions.
getPurchaseHistoryData()  : array<string|int, mixed>
Get Purchase History Data
getStatusData()  : array<string|int, mixed>
Protected support method for getStatus -- process rows returned by SQL lookup.
getStatusNoItemsSQL()  : array<string|int, mixed>
Protected support method for getStatus -- get components for status lookup SQL to use when a bib record has no items.
getStatusRanking()  : int
Support method for pickStatus() -- get the ranking value of the specified status message.
getStatusSQL()  : array<string|int, mixed>
Protected support method for getStatus -- get components required for standard status lookup SQL.
log()  : void
Send a message to the logger.
logError()  : void
Log an error message.
logWarning()  : void
Log a warning message.
pickStatus()  : string
Protected support method to pick which status message to display when multiple options are present.
pickTransactionStatus()  : string|bool
Pick a transaction status worth displaying to the user (or return false if nothing important is found).
processFinesData()  : array<string|int, mixed>
Protected support method for getMyFines.
processHoldingData()  : array<string|int, mixed>
Protected support method for getHolding.
processHoldingDueDate()  : string|bool
Support method for processHoldingData: format a due date for inclusion in holdings data.
processHoldingReturnDate()  : string|bool
Support method for processHoldingData: format a return date for inclusion in holdings data.
processHoldingRow()  : array<string|int, mixed>
Protected support method for getHolding.
processHoldsList()  : mixed
Process Holds List
processMyHoldsData()  : array<string|int, mixed>
Protected support method for getMyHolds.
processMyStorageRetrievalRequestsData()  : array<string|int, mixed>
Protected support method for getMyStorageRetrievalRequests.
processMyTransactionsData()  : array<string|int, mixed>
Protected support method for getMyTransactions.
processRecordSegment()  : array<string|int, mixed>
Protected support method for getHolding.
processStatusData()  : array<string|int, mixed>
Protected support method for getStatus -- process all details collected by getStatusData().
sanitizePIN()  : string
Sanitize patron PIN code (remove characters Voyager doesn't handle properly)
sanitizeTranslationKey()  : string
Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.
throwAsIlsException()  : never
Rethrow the provided exception as an ILS exception.
translateString()  : string
Get translation for a string

Properties

$config

Driver configuration

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

$dateFormat

Date formatting object

protected Converter $dateFormat

$dbName

Name of database

protected string $dbName

$displayDueTimeIntervals

Loan interval types for which to display the due time (empty = all)

protected array<string|int, mixed> $displayDueTimeIntervals

$lazyDb

Lazily instantiated database connection. Use getDb() to access it.

protected Oci8 $lazyDb

$statusRankings

Stored status rankings from the database; initialized to false but populated by the pickStatus() method.

protected array<string|int, mixed>|bool $statusRankings = false

$useHoldingsSortGroups

Whether to use holdings sort groups to sort holdings records

protected bool $useHoldingsSortGroups

Methods

__construct()

Constructor

public __construct(Converter $dateConverter) : mixed
Parameters
$dateConverter : Converter

Date converter object

Return values
mixed

cancelHolds()

Cancel hold requests.

public cancelHolds(array<string|int, mixed> $cancelDetails) : array<string|int, mixed>
Parameters
$cancelDetails : array<string|int, mixed>

An associative array with two keys: patron (array returned by the driver's patronLogin method) and details (an array of strings returned in holds' cancel_details field.

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

cancelILLRequests()

Cancel ILL Request

public cancelILLRequests(array<string|int, mixed> $cancelDetails) : array<string|int, mixed>

Attempts to Cancel an ILL request on a particular item. The data in $cancelDetails['details'] is determined by getCancelILLRequestDetails().

Parameters
$cancelDetails : array<string|int, mixed>

An array of item and patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

cancelStorageRetrievalRequests()

Cancel Storage Retrieval Request

public cancelStorageRetrievalRequests(array<string|int, mixed> $cancelDetails) : array<string|int, mixed>

Attempts to Cancel a Storage Retrieval Request on a particular item. The data in $cancelDetails['details'] is determined by getCancelStorageRetrievalRequestDetails().

Parameters
$cancelDetails : array<string|int, mixed>

An array of item and patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

checkILLRequestIsValid()

Check if ILL request available

public checkILLRequestIsValid(string $id, array<string|int, mixed> $data, array<string|int, mixed> $patron) : mixed

This is responsible for determining if an item is requestable

Parameters
$id : string

The Bib ID

$data : array<string|int, mixed>

An Array of item data

$patron : array<string|int, mixed>

An array of patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

An array of data on the request including whether or not it is valid and a status message. Alternatively a boolean true if request is valid, false if not.

checkRequestIsValid()

Check if hold or recall available

public checkRequestIsValid(string $id, array<string|int, mixed> $data, array<string|int, mixed> $patron) : mixed

This is responsible for determining if an item is requestable

Parameters
$id : string

The Bib ID

$data : array<string|int, mixed>

An Array of item data

$patron : array<string|int, mixed>

An array of patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

An array of data on the request including whether or not it is valid and a status message. Alternatively a boolean true if request is valid, false if not.

checkStorageRetrievalRequestIsValid()

Check if storage retrieval request available

public checkStorageRetrievalRequestIsValid(string $id, array<string|int, mixed> $data, array<string|int, mixed> $patron) : mixed

This is responsible for determining if an item is requestable

Parameters
$id : string

The Bib ID

$data : array<string|int, mixed>

An Array of item data

$patron : array<string|int, mixed>

An array of patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

An array of data on the request including whether or not it is valid and a status message. Alternatively a boolean true if request is valid, false if not.

findReserves()

Find Reserves

public findReserves(string $course, string $inst, string $dept) : array<string|int, mixed>

Obtain information on course reserves.

This version of findReserves was contributed by Matthew Hooper and includes support for electronic reserves (though eReserve support is still a work in progress).

Parameters
$course : string

ID from getCourses (empty string to match all)

$inst : string

ID from getInstructors (empty string to match all)

$dept : string

ID from getDepartments (empty string to match all)

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

An array of associative arrays representing reserve items.

getAccountBlocks()

Check whether the patron has any blocks on their account.

public getAccountBlocks(array<string|int, mixed> $patron) : mixed
Parameters
$patron : array<string|int, mixed>

Patron data from patronLogin().

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

A boolean false if no blocks are in place and an array of block reasons if blocks are in place

getCancelHoldDetails()

Get Cancel Hold Request Details

public getCancelHoldDetails(array<string|int, mixed> $request[, array<string|int, mixed> $patron = [] ]) : string
Parameters
$request : array<string|int, mixed>

An array of request data

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

Patron information from patronLogin

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
string

Data for use in a form field

getCancelILLRequestDetails()

Get Cancel ILL Request Details

public getCancelILLRequestDetails(array<string|int, mixed> $request, array<string|int, mixed> $patron) : string
Parameters
$request : array<string|int, mixed>

An array of request data

$patron : array<string|int, mixed>

Patron information from patronLogin

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
string

Data for use in a form field

getCancelStorageRetrievalRequestDetails()

Get Cancel Storage Retrieval Request Details

public getCancelStorageRetrievalRequestDetails(array<string|int, mixed> $request, array<string|int, mixed> $patron) : string
Parameters
$request : array<string|int, mixed>

An array of request data

$patron : array<string|int, mixed>

Patron information from patronLogin

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
string

Data for use in a form field

getConfig()

Public Function which specifies renew, hold and cancel settings.

public getConfig(string $function[, array<string|int, mixed> $params = null ]) : array<string|int, mixed>
Parameters
$function : string

The name of the feature to be checked

$params : array<string|int, mixed> = null

Optional feature-specific parameters (array)

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array with key-value pairs.

getCourses()

Get Courses

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

Obtain a list of courses for use in limiting the reserves list.

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

An associative array with key = ID, value = name.

getDefaultPickUpLocation()

Get Default Pick Up Location

public getDefaultPickUpLocation([array<string|int, mixed> $patron = false ][, array<string|int, mixed> $holdDetails = null ]) : false|string

Returns the default pick up location set in HorizonXMLAPI.ini

Parameters
$patron : array<string|int, mixed> = false

Patron information returned by the patronLogin method.

$holdDetails : array<string|int, mixed> = null

Optional array, only passed in when getting a list in the context of placing a hold; contains most of the same values passed to placeHold, minus the patron data. May be used to limit the pickup options or may be ignored.

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
false|string

The default pickup location for the patron or false if the user has to choose.

getDefaultRequestGroup()

Get Default Request Group

public getDefaultRequestGroup([array<string|int, mixed> $patron = false ][, array<string|int, mixed> $holdDetails = null ]) : false|string

Returns the default request group

Parameters
$patron : array<string|int, mixed> = false

Patron information returned by the patronLogin method.

$holdDetails : array<string|int, mixed> = null

Optional array, only passed in when getting a list in the context of placing a hold; contains most of the same values passed to placeHold, minus the patron data. May be used to limit the request group options or may be ignored.

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
false|string

The default request group for the patron.

getDepartments()

Get Departments

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

Obtain a list of departments for use in limiting the reserves list.

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

An associative array with key = dept. ID, value = dept. name.

getFunds()

Get Funds

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

Return a list of funds which may be used to limit the getNewItems list.

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

An associative array with key = fund ID, value = fund name.

getHolding()

Get Holding

public getHolding(string $id[, array<string|int, mixed> $patron = null ][, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>

This is responsible for retrieving the holding information of a certain record.

Parameters
$id : string

The record id to retrieve the holdings for

$patron : array<string|int, mixed> = null

Patron data

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

Extra options (not currently used)

Tags
throws
DateException
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

On success, an associative array with the following keys: id, availability (boolean), status, location, reserve, callnumber, duedate, number, barcode.

Get Hold Link

public getHoldLink(string $recordId, array<string|int, mixed> $details) : string

The goal for this method is to return a URL to a "place hold" web page on the ILS OPAC. This is used for ILSs that do not support an API or method to place Holds.

Parameters
$recordId : string

The id of the bib record

$details : array<string|int, mixed>

Item details from getHoldings return array

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
string

URL to ILS's OPAC's place hold screen.

getILLPickUpLibraries()

Get ILL Pickup Libraries

public getILLPickUpLibraries(string $id, array<string|int, mixed> $patron) : bool|array<string|int, mixed>

This is responsible for getting information on the possible pickup libraries

Parameters
$id : string

Record ID

$patron : array<string|int, mixed>

Patron

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
bool|array<string|int, mixed>

False if request not allowed, or an array of associative arrays with libraries.

getILLPickUpLocations()

Get ILL Pickup Locations

public getILLPickUpLocations(string $id, string $pickupLib, array<string|int, mixed> $patron) : bool|array<string|int, mixed>

This is responsible for getting a list of possible pickup locations for a library

Parameters
$id : string

Record ID

$pickupLib : string

Pickup library ID

$patron : array<string|int, mixed>

Patron

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
bool|array<string|int, mixed>

False if request not allowed, or an array of locations.

getInstructors()

Get Instructors

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

Obtain a list of instructors for use in limiting the reserves list.

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

An associative array with key = ID, value = name.

getMyFines()

Get Patron Fines

public getMyFines(array<string|int, mixed> $patron) : mixed

This is responsible for retrieving all fines by a specific patron.

Parameters
$patron : array<string|int, mixed>

The patron array from patronLogin

Tags
throws
DateException
throws
ILS
Return values
mixed

Array of the patron's fines on success.

getMyHolds()

Get Patron Holds

public getMyHolds(array<string|int, mixed> $patron) : array<string|int, mixed>

This is responsible for retrieving all holds by a specific patron.

Parameters
$patron : array<string|int, mixed>

The patron array from patronLogin

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

Array of the patron's holds on success.

getMyILLRequests()

Get Patron ILL Requests

public getMyILLRequests(array<string|int, mixed> $patron) : mixed

This is responsible for retrieving all ILL requests by a specific patron.

Parameters
$patron : array<string|int, mixed>

The patron array from patronLogin

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

Array of the patron's ILL requests

getMyProfile()

Get Patron Profile

public getMyProfile(array<string|int, mixed> $patron) : array<string|int, mixed>

This is responsible for retrieving the profile for a specific patron.

Parameters
$patron : array<string|int, mixed>

The patron array

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

Array of the patron's profile data on success.

getMyStorageRetrievalRequests()

Get Patron Storage Retrieval Requests

public getMyStorageRetrievalRequests(array<string|int, mixed> $patron) : array<string|int, mixed>

This is responsible for retrieving all call slips by a specific patron.

Parameters
$patron : array<string|int, mixed>

The patron array from patronLogin

Return values
array<string|int, mixed>

Array of the patron's storage retrieval requests.

getMyTransactions()

Get Patron Transactions

public getMyTransactions(array<string|int, mixed> $patron) : array<string|int, mixed>

This is responsible for retrieving all transactions (i.e. checked out items) by a specific patron.

Parameters
$patron : array<string|int, mixed>

The patron array from patronLogin

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

Array of the patron's transactions on success.

getNewItems()

Get New Items

public getNewItems(int $page, int $limit, int $daysOld[, int $fundId = null ]) : array<string|int, mixed>

Retrieve the IDs of items recently added to the catalog.

Parameters
$page : int

Page number of results to retrieve (counting starts at 1)

$limit : int

The size of each page of results to retrieve

$daysOld : int

The maximum age of records to retrieve in days (max. 30)

$fundId : int = null

optional fund ID to use for limiting results (use a value returned by getFunds, or exclude for no limit); note that "fund" may be a misnomer - if funds are not an appropriate way to limit your new item results, you can return a different set of values from getFunds. The important thing is that this parameter supports an ID returned by getFunds, whatever that may mean.

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

Associative array with 'count' and 'results' keys

getPickUpLocations()

Get Pick Up Locations

public getPickUpLocations([array<string|int, mixed> $patron = false ][, array<string|int, mixed> $holdDetails = null ]) : array<string|int, mixed>

This is responsible get a list of valid library locations for holds / recall retrieval

Parameters
$patron : array<string|int, mixed> = false

Patron information returned by the patronLogin method.

$holdDetails : array<string|int, mixed> = null

Optional array, only passed in when getting a list in the context of placing or editing a hold. When placing a hold, it contains most of the same values passed to placeHold, minus the patron data. When editing a hold it contains all the hold information returned by getMyHolds. May be used to limit the pickup options or may be ignored. The driver must not add new options to the return array based on this data or other areas of VuFind may behave incorrectly.

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array of associative arrays with locationID and locationDisplay keys

getPurchaseHistory()

Get Purchase History

public getPurchaseHistory(string $id) : array<string|int, mixed>

This is responsible for retrieving the acquisitions history data for the specific record (usually recently received issues of a serial).

Parameters
$id : string

The record id to retrieve the info for

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

An array with the acquisitions data on success.

getRecentlyReturnedBibs()

Get bib records for recently returned items.

public getRecentlyReturnedBibs([int $limit = 30 ][, int $maxage = 30 ][, array<string|int, mixed> $patron = null ]) : array<string|int, mixed>
Parameters
$limit : int = 30

Maximum number of records to retrieve (default = 30)

$maxage : int = 30

The maximum number of days to consider "recently returned."

$patron : array<string|int, mixed> = null

Patron Data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

getRenewDetails()

Get Renew Details

public getRenewDetails(array<string|int, mixed> $checkoutDetails) : string

In order to renew an item, Voyager requires the patron details and an item id. This function returns the item id as a string which is then used as submitted form data in checkedOut.php. This value is then extracted by the RenewMyItems function.

Parameters
$checkoutDetails : array<string|int, mixed>

An array of item data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
string

Data for use in a form field

getRequestBlocks()

Check whether the patron is blocked from placing requests (holds/ILL/SRR).

public getRequestBlocks(array<string|int, mixed> $patron) : mixed
Parameters
$patron : array<string|int, mixed>

Patron data from patronLogin().

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

A boolean false if no blocks are in place and an array of block reasons if blocks are in place

getRequestGroups()

Get request groups

public getRequestGroups([int $bibId = null ][, array<string|int, mixed> $patron = null ][, array<string|int, mixed> $holdDetails = null ]) : array<string|int, mixed>
Parameters
$bibId : int = null

BIB ID

$patron : array<string|int, mixed> = null

Patron information returned by the patronLogin method.

$holdDetails : array<string|int, mixed> = null

Optional array, only passed in when getting a list in the context of placing a hold; contains most of the same values passed to placeHold, minus the patron data. May be used to limit the request group options or may be ignored.

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

False if request groups not in use or an array of associative arrays with id and name keys

getStatus()

Get Status

public getStatus(string $id) : mixed

This is responsible for retrieving the status information of a certain record.

Parameters
$id : string

The record id to retrieve the holdings for

Tags
throws
ILS
Return values
mixed

On success, an associative array with the following keys: id, availability (boolean), status, location, reserve, callnumber.

getStatuses()

Get Statuses

public getStatuses(array<string|int, mixed> $idList) : array<string|int, mixed>

This is responsible for retrieving the status information for a collection of records.

Parameters
$idList : array<string|int, mixed>

The array of record ids to retrieve the status for

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

An array of getStatus() return values on success.

getSuppressedRecords()

Get suppressed records.

public getSuppressedRecords() : array<string|int, mixed>
Tags
throws
ILS
Return values
array<string|int, mixed>

ID numbers of suppressed records in the system.

getTranslator()

Get translator object.

public getTranslator() : TranslatorInterface
Return values
TranslatorInterface

getTranslatorLocale()

Get the locale from the translator.

public getTranslatorLocale([string $default = 'en' ]) : string
Parameters
$default : string = 'en'

Default to use if translator absent.

Return values
string

getTrendingBibs()

Get bib records for "trending" items (recently returned with high usage).

public getTrendingBibs([int $limit = 30 ][, int $maxage = 30 ][, array<string|int, mixed> $patron = null ]) : array<string|int, mixed>
Parameters
$limit : int = 30

Maximum number of records to retrieve (default = 30)

$maxage : int = 30

The maximum number of days' worth of data to examine.

$patron : array<string|int, mixed> = null

Patron Data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

init()

Initialize the driver.

public init() : void

Validate configuration and perform all resource-intensive tasks needed to make the driver active.

Tags
throws
ILS
Return values
void

loginIsHidden()

Is login disabled?

public loginIsHidden() : bool
Return values
bool

patronLogin()

Patron Login

public patronLogin(string $username, string $login) : mixed

This is responsible for authenticating a patron against the catalog.

Parameters
$username : string

The patron barcode or institution ID (depending on config)

$login : string

The patron's last name or PIN (depending on config)

Tags
throws
ILS
Return values
mixed

Associative array of patron info on successful login, null on unsuccessful login.

placeHold()

Place Hold

public placeHold(array<string|int, mixed> $holdDetails) : mixed

Attempts to place a hold or recall on a particular item and returns an array with result details.

Parameters
$holdDetails : array<string|int, mixed>

An array of item and patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

An array of data on the request including whether or not it was successful and a system message (if available)

placeILLRequest()

Place ILL Request

public placeILLRequest(array<string|int, mixed> $holdDetails) : mixed

Attempts to place an ILL request on a particular item and returns an array with result details

Parameters
$holdDetails : array<string|int, mixed>

An array of item and patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

An array of data on the request including whether or not it was successful and a system message (if available)

placeStorageRetrievalRequest()

Place a Storage Retrieval Request

public placeStorageRetrievalRequest(array<string|int, mixed> $details) : mixed

Attempts to place a request on a particular item and returns an array with result details.

Parameters
$details : array<string|int, mixed>

An array of item and patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

An array of data on the request including whether or not it was successful and a system message (if available)

renewMyItems()

Renew My Items

public renewMyItems(array<string|int, mixed> $renewDetails) : array<string|int, mixed>

Function for attempting to renew a patron's items. The data in $renewDetails['details'] is determined by getRenewDetails().

Parameters
$renewDetails : array<string|int, mixed>

An array of data required for renewing items including the Patron ID and an array of renewal IDS

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array of renewal information keyed by item ID

setConfig()

Set configuration.

public setConfig(array<string|int, mixed> $config) : void

Set the configuration for the driver.

Parameters
$config : array<string|int, mixed>

Configuration array (usually loaded from a VuFind .ini file whose name corresponds with the driver class name).

Return values
void

translate()

Translate a string (or string-castable object)

public translate(string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, bool $useIcuFormatter = false ][, array<string|int, string> $fallbackDomains = [] ]) : string
Parameters
$target : string|object|array<string|int, mixed>

String to translate or an array of text domain and string to translate

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

Tokens to inject into the translated string

$default : string = null

Default value to use if no translation is found (null for no default).

$useIcuFormatter : bool = false

Should we use an ICU message formatter instead of the default behavior?

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

Text domains to check if no match is found in the domain specified in $target

Return values
string

translateWithPrefix()

Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.

public translateWithPrefix(string $prefix, string|object|array<string|int, mixed> $target[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, bool $useIcuFormatter = false ][, array<string|int, string> $fallbackDomains = [] ]) : string
Parameters
$prefix : string

Translation key prefix

$target : string|object|array<string|int, mixed>

String to translate or an array of text domain and string to translate

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

Tokens to inject into the translated string

$default : string = null

Default value to use if no translation is found (null for no default).

$useIcuFormatter : bool = false

Should we use an ICU message formatter instead of the default behavior?

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

Text domains to check if no match is found in the domain specified in $target

Return values
string

buildSqlFromArray()

Protected support method for building sql strings.

protected buildSqlFromArray(array<string|int, mixed> $sql) : array<string|int, mixed>
Parameters
$sql : array<string|int, mixed>

An array of keyed sql data

Return values
array<string|int, mixed>

An string query string and bind data

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

debugSQL()

Log an SQL statement debug message.

protected debugSQL(string $func, string $sql[, array<string|int, mixed> $params = null ]) : void
Parameters
$func : string

Function name or description

$sql : string

The SQL statement

$params : array<string|int, mixed> = null

SQL bind parameters

Return values
void

determineAvailability()

Protected support method to take an array of status strings and determine whether or not this indicates an available item. Returns an array with two keys: 'available', the boolean availability status, and 'otherStatuses', every status code found other than "Not Charged" - for use with pickStatus().

protected determineAvailability(array<string|int, mixed> $statusArray) : array<string|int, mixed>
Parameters
$statusArray : array<string|int, mixed>

The status codes to analyze.

Return values
array<string|int, mixed>

Availability and other status information.

executeSQL()

Execute an SQL query

protected executeSQL(string|array<string|int, mixed> $sql[, array<string|int, mixed> $bind = [] ]) : PDOStatement
Parameters
$sql : string|array<string|int, mixed>

SQL statement (string or array that includes bind params)

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

Bind parameters (if $sql is string)

Return values
PDOStatement

extractTextDomain()

Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.

protected extractTextDomain(string|object|array<string|int, mixed> $target) : array<string|int, mixed>
Parameters
$target : string|object|array<string|int, mixed>

String to translate or an array of text domain and string to translate

Return values
array<string|int, mixed>

getDb()

Initialize database connection if necessary and return it.

protected getDb() : PDO
Tags
throws
ILS
Return values
PDO

getDebugTranslation()

Build a debug-mode translation

protected getDebugTranslation(string $domain, string $str, array<string|int, mixed> $tokens) : string
Parameters
$domain : string

Text domain

$str : string

String to translate

$tokens : array<string|int, mixed>

Tokens to inject into the translated string

Return values
string

getFineSQL()

Protected support method for getMyFines.

protected getFineSQL(array<string|int, mixed> $patron) : array<string|int, mixed>
Parameters
$patron : array<string|int, mixed>

Patron data for use in an sql query

Return values
array<string|int, mixed>

Keyed data for use in an sql query

getHoldingData()

Protected support method for getHolding.

protected getHoldingData(array<string|int, mixed> $sqlRows) : array<string|int, mixed>
Parameters
$sqlRows : array<string|int, mixed>

Sql Data

Return values
array<string|int, mixed>

Keyed data

getHoldingItemsSQL()

Protected support method for getHolding.

protected getHoldingItemsSQL(array<string|int, mixed> $id) : array<string|int, mixed>
Parameters
$id : array<string|int, mixed>

A Bibliographic id

Return values
array<string|int, mixed>

Keyed data for use in an sql query

getHoldingNoItemsSQL()

Protected support method for getHolding.

protected getHoldingNoItemsSQL(array<string|int, mixed> $id) : array<string|int, mixed>
Parameters
$id : array<string|int, mixed>

A Bibliographic id

Return values
array<string|int, mixed>

Keyed data for use in an sql query

getItemSortSequenceSQL()

Helper function that returns SQL for getting a sort sequence for a location

protected getItemSortSequenceSQL(string $locationColumn) : string
Parameters
$locationColumn : string

Column in the full where clause containing the column id

Return values
string

getLocationName()

Look up a location name by ID.

protected getLocationName(int $id) : string
Parameters
$id : int

Location ID to look up

Return values
string

getMFHDData()

Get specified fields from an MFHD MARC Record

protected getMFHDData(MarcReader $record, array<string|int, mixed>|string $fieldSpecs) : string|array<string|int, mixed>
Parameters
$record : MarcReader

Marc reader

$fieldSpecs : array<string|int, mixed>|string

Array or colon-separated list of field/subfield specifications (3 chars for field code and then subfields, e.g. 866az)

Return values
string|array<string|int, mixed>

Results as a string if single, array if multiple

getMyHoldsSQL()

Protected support method for getMyHolds.

protected getMyHoldsSQL(array<string|int, mixed> $patron) : array<string|int, mixed>
Parameters
$patron : array<string|int, mixed>

Patron data for use in an sql query

Return values
array<string|int, mixed>

Keyed data for use in an sql query

getMyStorageRetrievalRequestsSQL()

Protected support method for getMyStorageRetrievalRequests.

protected getMyStorageRetrievalRequestsSQL(array<string|int, mixed> $patron) : array<string|int, mixed>
Parameters
$patron : array<string|int, mixed>

Patron data for use in an sql query

Return values
array<string|int, mixed>

Keyed data for use in an sql query

getMyTransactionsSQL()

Protected support method for getMyTransactions.

protected getMyTransactionsSQL(array<string|int, mixed> $patron) : array<string|int, mixed>
Parameters
$patron : array<string|int, mixed>

Patron data for use in an sql query

Return values
array<string|int, mixed>

Keyed data for use in an sql query

getPurchaseHistoryData()

Get Purchase History Data

protected getPurchaseHistoryData(string $id) : array<string|int, mixed>

This is responsible for retrieving the acquisitions history data for the specific record (usually recently received issues of a serial). It is used by getHoldings() and getPurchaseHistory() depending on whether the purchase history is displayed by holdings or in a separate list.

Parameters
$id : string

The record id to retrieve the info for

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

An array with the acquisitions data on success.

getStatusData()

Protected support method for getStatus -- process rows returned by SQL lookup.

protected getStatusData(array<string|int, mixed> $sqlRows) : array<string|int, mixed>
Parameters
$sqlRows : array<string|int, mixed>

Sql Data

Return values
array<string|int, mixed>

Keyed data

getStatusNoItemsSQL()

Protected support method for getStatus -- get components for status lookup SQL to use when a bib record has no items.

protected getStatusNoItemsSQL(array<string|int, mixed> $id) : array<string|int, mixed>
Parameters
$id : array<string|int, mixed>

A Bibliographic id

Return values
array<string|int, mixed>

Keyed data for use in an sql query

getStatusRanking()

Support method for pickStatus() -- get the ranking value of the specified status message.

protected getStatusRanking(string $status) : int
Parameters
$status : string

Status message to look up

Return values
int

getStatusSQL()

Protected support method for getStatus -- get components required for standard status lookup SQL.

protected getStatusSQL(array<string|int, mixed> $id) : array<string|int, mixed>
Parameters
$id : array<string|int, mixed>

A Bibliographic id

Return values
array<string|int, mixed>

Keyed data for use in an sql query

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

pickStatus()

Protected support method to pick which status message to display when multiple options are present.

protected pickStatus(array<string|int, mixed> $statusArray) : string
Parameters
$statusArray : array<string|int, mixed>

Array of status messages to choose from.

Tags
throws
ILS
Return values
string

The best status message to display.

pickTransactionStatus()

Pick a transaction status worth displaying to the user (or return false if nothing important is found).

protected pickTransactionStatus(array<string|int, mixed> $statuses) : string|bool
Parameters
$statuses : array<string|int, mixed>

Status strings

Return values
string|bool

processFinesData()

Protected support method for getMyFines.

protected processFinesData(array<string|int, mixed> $sqlRow) : array<string|int, mixed>
Parameters
$sqlRow : array<string|int, mixed>

An array of keyed data

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

Keyed data for display by template files

processHoldingData()

Protected support method for getHolding.

protected processHoldingData(array<string|int, mixed> $data, string $id[, array<string|int, mixed> $patron = null ]) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

Item Data

$id : string

The BIB record id

$patron : array<string|int, mixed> = null

Patron Data

Tags
throws
DateException
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

Keyed data

processHoldingDueDate()

Support method for processHoldingData: format a due date for inclusion in holdings data.

protected processHoldingDueDate(array<string|int, mixed> $row) : string|bool
Parameters
$row : array<string|int, mixed>

Row to process

Return values
string|bool

processHoldingReturnDate()

Support method for processHoldingData: format a return date for inclusion in holdings data.

protected processHoldingReturnDate(array<string|int, mixed> $row) : string|bool
Parameters
$row : array<string|int, mixed>

Row to process

Return values
string|bool

processHoldingRow()

Protected support method for getHolding.

protected processHoldingRow(array<string|int, mixed> $sqlRow) : array<string|int, mixed>
Parameters
$sqlRow : array<string|int, mixed>

SQL Row Data

Return values
array<string|int, mixed>

Keyed data

processHoldsList()

Process Holds List

protected processHoldsList(array<string|int, mixed> $holdList) : mixed

This is responsible for processing holds to ensure only one record is shown for each hold.

Parameters
$holdList : array<string|int, mixed>

The Hold List Array

Return values
mixed

Array of the patron's holds.

processMyHoldsData()

Protected support method for getMyHolds.

protected processMyHoldsData(array<string|int, mixed> $sqlRow) : array<string|int, mixed>
Parameters
$sqlRow : array<string|int, mixed>

An array of keyed data

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

Keyed data for display by template files

processMyStorageRetrievalRequestsData()

Protected support method for getMyStorageRetrievalRequests.

protected processMyStorageRetrievalRequestsData(array<string|int, mixed> $sqlRow) : array<string|int, mixed>
Parameters
$sqlRow : array<string|int, mixed>

An array of keyed data

Return values
array<string|int, mixed>

Keyed data for display by template files

processMyTransactionsData()

Protected support method for getMyTransactions.

protected processMyTransactionsData(array<string|int, mixed> $sqlRow[, array<string|int, mixed> $patron = false ]) : array<string|int, mixed>
Parameters
$sqlRow : array<string|int, mixed>

An array of keyed data

$patron : array<string|int, mixed> = false

An array of keyed patron data

Tags
throws
DateException
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

Keyed data for display by template files

processRecordSegment()

Protected support method for getHolding.

protected processRecordSegment(array<string|int, mixed> $recordSegment) : array<string|int, mixed>
Parameters
$recordSegment : array<string|int, mixed>

A Marc Record Segment obtained from an SQL query

Return values
array<string|int, mixed>

Keyed data

processStatusData()

Protected support method for getStatus -- process all details collected by getStatusData().

protected processStatusData(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>

SQL Row Data

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

Keyed data

sanitizePIN()

Sanitize patron PIN code (remove characters Voyager doesn't handle properly)

protected sanitizePIN(string $pin) : string
Parameters
$pin : string

PIN code to sanitize

Return values
string

Sanitized PIN code

sanitizeTranslationKey()

Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.

protected sanitizeTranslationKey(string $key) : string
Parameters
$key : string

Key to sanitize

Return values
string

Sanitized key

throwAsIlsException()

Rethrow the provided exception as an ILS exception.

protected throwAsIlsException(Throwable $exception[, string $msg = null ]) : never
Parameters
$exception : Throwable

Exception to rethrow

$msg : string = null

Override exception message (optional)

Tags
throws
ILS
Return values
never

translateString()

Get translation for a string

protected translateString(string $rawStr[, array<string|int, mixed> $tokens = [] ][, string $default = null ][, string $domain = 'default' ][, bool $useIcuFormatter = false ]) : string
Parameters
$rawStr : string

String to translate

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

Tokens to inject into the translated string

$default : string = null

Default value to use if no translation is found (null for no default).

$domain : string = 'default'

Text domain (omit for default)

$useIcuFormatter : bool = false

Should we use an ICU message formatter instead of the default behavior?

Return values
string

Search results