VuFind API Documentation

Demo extends AbstractBase
in package
implements HasSorterInterface Uses HasSorterTrait

Advanced Dummy ILS Driver -- Returns sample values based on Solr index.

Tags
category

VuFind

author

Greg Pendlebury vufind-tech@lists.sourceforge.net

author

Ere Maijala ere.maijala@helsinki.fi

license

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

link

Wiki

Interfaces, Classes, Traits and Enums

HasSorterInterface
Interface SortingInterface

Table of Contents

$catalogId  : string
Catalog ID used to distinquish between multiple Demo driver instances with the MultiBackend driver
$config  : array<string|int, mixed>
Driver configuration
$courses  : array<string|int, mixed>
Courses for use in course reserves.
$dateConverter  : Converter
Date converter object
$defaultPickUpLocation  : string
Default pickup location
$departments  : array<string|int, mixed>
Departments for use in course reserves.
$failureProbabilities  : array<string|int, mixed>
Failure probability settings
$idsInMyResearch  : bool
Should we return bib IDs in MyResearch responses?
$ILLRequests  : bool
Should we support ILLRequests?
$instructors  : array<string|int, mixed>
Instructors for use in course reserves.
$locations  : array<string|int, mixed>
Item and pick up locations
$request  : Request|null
HTTP Request object (if available).
$searchService  : Service
Connection used when getting random bib ids from Solr
$session  : array<string|int, Container>
Container for storing persistent simulated ILS data.
$sessionFactory  : callable
Factory function for constructing the SessionContainer.
$sorter  : SorterInterface|null
Sorter
$storageRetrievalRequests  : bool
Should we support Storage Retrieval Requests?
$totalRecords  : int
Total count of records in the Solr index (used for random bib lookup)
__construct()  : mixed
Constructor
cancelHolds()  : array<string|int, mixed>
Cancel Holds
cancelILLRequests()  : array<string|int, mixed>
Cancel ILL Request
cancelStorageRetrievalRequests()  : array<string|int, mixed>
Cancel Storage Retrieval Request
changePassword()  : array<string|int, mixed>
Change Password
checkILLRequestIsValid()  : mixed
Check if ILL request available
checkRequestIsValid()  : mixed
Check if hold or recall available
checkStorageRetrievalRequestIsValid()  : mixed
Check if storage retrieval request available
findReserves()  : mixed
Find Reserves
getAccountBlocks()  : mixed
Check whether the patron has any blocks on their account.
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
getHoldDefaultRequiredDate()  : int|null
Get Default "Hold Required By" Date (as Unix timestamp) or null if unsupported
getHolding()  : array<string|int, mixed>
Get Holding
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()  : mixed
Get Patron Holds
getMyILLRequests()  : mixed
Get Patron ILL Requests
getMyProfile()  : array<string|int, mixed>
Get Patron Profile
getMyStorageRetrievalRequests()  : mixed
Get Patron Storage Retrieval Requests
getMyTransactionHistory()  : mixed
Get Patron Loan History
getMyTransactions()  : mixed
Get Patron Transactions
getNewItems()  : array<string|int, mixed>
Get New Items
getPickUpLocations()  : array<string|int, mixed>
Get Pick Up Locations
getProxiedUsers()  : array<string|int, mixed>
Get list of users for whom the provided patron is a proxy.
getProxyingUsers()  : array<string|int, mixed>
Get list of users who act as proxies for the provided patron.
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
getSorter()  : SorterInterface
Get the sorter
getStatus()  : mixed
Get Status
getStatuses()  : array<string|int, mixed>
Get Statuses
getSuppressedRecords()  : array<string|int, mixed>
Get suppressed records.
getTrendingBibs()  : array<string|int, mixed>
Get bib records for "trending" items (recently returned with high usage).
getUrlsForRecord()  : array<string|int, mixed>
Provide an array of URL data (in the same format returned by the record driver's getURLs method) for the specified bibliographic record.
init()  : void
Initialize the driver.
patronLogin()  : mixed
Patron Login
placeHold()  : mixed
Place Hold
placeILLRequest()  : mixed
Place ILL Request
placeStorageRetrievalRequest()  : mixed
Place a Storage Retrieval Request
purgeTransactionHistory()  : array<string|int, mixed>
Purge Patron Transaction History
renewMyItems()  : array<string|int, mixed>
Renew My Items
setConfig()  : void
Set configuration.
setSorter()  : void
Set the sorter
updateHolds()  : array<string|int, mixed>
Update holds
calculateDueStatus()  : string
Calculate the due status for a due date.
checkIntermittentFailure()  : void
Should we simulate a system failure?
checkRenewBlock()  : bool
Are renewals blocked?
createRequestList()  : ArrayObject
Generate a list of holds, storage retrieval requests or ILL requests.
getCourseId()  : string
Determine a course ID for findReserves.
getDepartmentId()  : string
Determine a department ID for findReserves.
getFakeCallNum()  : string
Generate a fake call number.
getFakeCallNumPrefix()  : string
Generate a fake call number prefix sometimes.
getFakeLoc()  : string
Generate a fake location name.
getFakeServices()  : array<string|int, mixed>
Generate fake services.
getFakeStatus()  : string
Generate a fake status message.
getHistoricTransactionList()  : array<string|int, mixed>
Construct a historic transaction list for getMyTransactionHistory; may be random or pre-set depending on Demo.ini settings.
getInstructorId()  : string
Determine an instructor ID for findReserves.
getRandomBibId()  : string
Get a random ID from the Solr index.
getRandomBibIdAndTitle()  : array<string|int, mixed>
Get a random ID and title from the Solr index.
getRandomBibIds()  : array<string|int, string>
Get a set of random bib IDs
getRandomHistoricTransactionList()  : array<string|int, mixed>
Construct a random set of transactions for getMyTransactionHistory().
getRandomHolding()  : array<string|int, mixed>
Generates a random, fake holding array
getRandomItemIdentifier()  : array<string|int, mixed>
Generate an associative array containing some sort of ID (for cover generation).
getRandomTransactionList()  : array<string|int, mixed>
Construct a random set of transactions for getMyTransactions().
getRecordSource()  : string
Get the name of the search backend providing records.
getSession()  : Container
Get the session container (constructing it on demand if not already present)
getSimulatedStatus()  : mixed
Get Simulated Status (support method for getStatus/getHolding)
getTransactionList()  : array<string|int, mixed>
Construct a transaction list for getMyTransactions; may be random or pre-set depending on Demo.ini settings.
isFailing()  : bool
Check for a simulated failure. Returns true for failure, false for success.
setStatus()  : array<string|int, mixed>
Set Status
throwAsIlsException()  : never
Rethrow the provided exception as an ILS exception.

Properties

$catalogId

Catalog ID used to distinquish between multiple Demo driver instances with the MultiBackend driver

protected string $catalogId = 'demo'

$config

Driver configuration

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

$courses

Courses for use in course reserves.

protected array<string|int, mixed> $courses = ['Course A', 'Course B', 'Course C']

$dateConverter

Date converter object

protected Converter $dateConverter

$defaultPickUpLocation

Default pickup location

protected string $defaultPickUpLocation

$departments

Departments for use in course reserves.

protected array<string|int, mixed> $departments = ['Dept. A', 'Dept. B', 'Dept. C']

$failureProbabilities

Failure probability settings

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

$idsInMyResearch

Should we return bib IDs in MyResearch responses?

protected bool $idsInMyResearch = true

$ILLRequests

Should we support ILLRequests?

protected bool $ILLRequests = true

$instructors

Instructors for use in course reserves.

protected array<string|int, mixed> $instructors = ['Instructor A', 'Instructor B', 'Instructor C']

$locations

Item and pick up locations

protected array<string|int, mixed> $locations = [['locationID' => 'A', 'locationDisplay' => 'Campus A'], ['locationID' => 'B', 'locationDisplay' => 'Campus B'], ['locationID' => 'C', 'locationDisplay' => 'Campus C']]

$request

HTTP Request object (if available).

protected Request|null $request

$searchService

Connection used when getting random bib ids from Solr

protected Service $searchService

$session

Container for storing persistent simulated ILS data.

protected array<string|int, Container> $session = []

$sessionFactory

Factory function for constructing the SessionContainer.

protected callable $sessionFactory

$storageRetrievalRequests

Should we support Storage Retrieval Requests?

protected bool $storageRetrievalRequests = true

$totalRecords

Total count of records in the Solr index (used for random bib lookup)

protected int $totalRecords

Methods

__construct()

Constructor

public __construct(Converter $dateConverter, Service $ss, callable $sessionFactory[, Request $request = null ]) : mixed
Parameters
$dateConverter : Converter

Date converter object

$ss : Service

Search service

$sessionFactory : callable

Factory function returning SessionContainer object for fake data to simulate consistency and reduce Solr hits

$request : Request = null

HTTP request object (optional)

Return values
mixed

cancelHolds()

Cancel Holds

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

Attempts to Cancel a hold or recall on a particular item.

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

An array of item and patron data

Return values
array<string|int, mixed>

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

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

Return values
array<string|int, mixed>

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

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

Return values
array<string|int, mixed>

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

changePassword()

Change Password

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

Attempts to change patron password (PIN code)

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

An array of patron id and old and new password:

'patron' The patron array from patronLogin 'oldPassword' Old password 'newPassword' New password

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

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

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) : mixed

Obtain information on course reserves.

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
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
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

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

In order to cancel a hold, Voyager requires the patron details an item ID and a recall ID. This function returns the item id and recall id as a string separated by a pipe, which is then submitted as form data in Hold.php. This value is then extracted by the CancelHolds function.

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 = [] ]) : array<string|int, mixed>
Parameters
$function : string

The name of the feature to be checked

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

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.

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.

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.

Return values
array<string|int, mixed>

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

getHoldDefaultRequiredDate()

Get Default "Hold Required By" Date (as Unix timestamp) or null if unsupported

public getHoldDefaultRequiredDate(array<string|int, mixed> $patron, array<string|int, mixed> $holdInfo) : int|null
Parameters
$patron : array<string|int, mixed>

Patron information returned by the patronLogin method.

$holdInfo : array<string|int, mixed>

Contains most of the same values passed to placeHold, minus the patron data.

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
int|null

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

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.

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.

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
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

Array of the patron's fines on success.

getMyHolds()

Get Patron Holds

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

This is responsible for retrieving all holds 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 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

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) : mixed

This is responsible for retrieving all call slips 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 holds

getMyTransactionHistory()

Get Patron Loan History

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

This is responsible for retrieving all historic transactions for a specific patron.

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

The patron array from patronLogin

$params : array<string|int, mixed>

Parameters

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

Array of the patron's historic transactions on success.

getMyTransactions()

Get Patron Transactions

public getMyTransactions(array<string|int, mixed> $patron[, array<string|int, mixed> $params = [] ]) : 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

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

Parameters

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
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
SuppressWarnings

(PHPMD.UnusedFormalParameter)

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

getProxiedUsers()

Get list of users for whom the provided patron is a proxy.

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

The patron array with username and password

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

getProxyingUsers()

Get list of users who act as proxies for the provided patron.

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

The patron array with username and password

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

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

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

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

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> $ids) : array<string|int, mixed>

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

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

The array of record ids to retrieve the status for

Return values
array<string|int, mixed>

An array of getStatus() return values on success.

getSuppressedRecords()

Get suppressed records.

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

ID numbers of suppressed records in the system.

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

Return values
array<string|int, mixed>

getUrlsForRecord()

Provide an array of URL data (in the same format returned by the record driver's getURLs method) for the specified bibliographic record.

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

Bibliographic record ID

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

patronLogin()

Patron Login

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

This is responsible for authenticating a patron against the catalog.

Parameters
$username : string

The patron username

$password : string

The patron password

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

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> $details) : mixed

Attempts to place an ILL 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

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

Return values
mixed

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

purgeTransactionHistory()

Purge Patron Transaction History

public purgeTransactionHistory(array<string|int, mixed> $patron, array<string|int, mixed>|null $ids) : array<string|int, mixed>
Parameters
$patron : array<string|int, mixed>

The patron array from patronLogin

$ids : array<string|int, mixed>|null

IDs to purge, or null for all

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

Associative array of the results

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

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

updateHolds()

Update holds

public updateHolds(array<string|int, mixed> $holdsDetails, array<string|int, mixed> $fields, array<string|int, mixed> $patron) : array<string|int, mixed>

This is responsible for changing the status of hold requests

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

The details identifying the holds

$fields : array<string|int, mixed>

An associative array of fields to be updated

$patron : array<string|int, mixed>

Patron array

Return values
array<string|int, mixed>

Associative array of the results

calculateDueStatus()

Calculate the due status for a due date.

protected calculateDueStatus(int $due) : string
Parameters
$due : int

Due date as Unix timestamp

Return values
string

checkIntermittentFailure()

Should we simulate a system failure?

protected checkIntermittentFailure() : void
Tags
throws
ILS
Return values
void

checkRenewBlock()

Are renewals blocked?

protected checkRenewBlock() : bool
Return values
bool

createRequestList()

Generate a list of holds, storage retrieval requests or ILL requests.

protected createRequestList(string $requestType) : ArrayObject
Parameters
$requestType : string

Request type (Holds, StorageRetrievalRequests or ILLRequests)

Return values
ArrayObject

List of requests

getCourseId()

Determine a course ID for findReserves.

protected getCourseId([string $course = '' ]) : string
Parameters
$course : string = ''

Course ID (or empty for a random choice)

Return values
string

getDepartmentId()

Determine a department ID for findReserves.

protected getDepartmentId([string $dept = '' ]) : string
Parameters
$dept : string = ''

Department ID (or empty for a random choice)

Return values
string

getFakeCallNum()

Generate a fake call number.

protected getFakeCallNum() : string
Return values
string

getFakeCallNumPrefix()

Generate a fake call number prefix sometimes.

protected getFakeCallNumPrefix() : string
Return values
string

getFakeLoc()

Generate a fake location name.

protected getFakeLoc([bool $returnText = true ]) : string
Parameters
$returnText : bool = true

If true, return location text; if false, return ID

Return values
string

getFakeServices()

Generate fake services.

protected getFakeServices() : array<string|int, mixed>
Return values
array<string|int, mixed>

getFakeStatus()

Generate a fake status message.

protected getFakeStatus() : string
Return values
string

getHistoricTransactionList()

Construct a historic transaction list for getMyTransactionHistory; may be random or pre-set depending on Demo.ini settings.

protected getHistoricTransactionList() : array<string|int, mixed>
Return values
array<string|int, mixed>

getInstructorId()

Determine an instructor ID for findReserves.

protected getInstructorId([string $inst = '' ]) : string
Parameters
$inst : string = ''

Instructor ID (or empty for a random choice)

Return values
string

getRandomBibId()

Get a random ID from the Solr index.

protected getRandomBibId() : string
Return values
string

getRandomBibIdAndTitle()

Get a random ID and title from the Solr index.

protected getRandomBibIdAndTitle() : array<string|int, mixed>
Return values
array<string|int, mixed>

[id, title]

getRandomBibIds()

Get a set of random bib IDs

protected getRandomBibIds(int $limit) : array<string|int, string>
Parameters
$limit : int

Maximum number of IDs to return (max 30)

Return values
array<string|int, string>

getRandomHistoricTransactionList()

Construct a random set of transactions for getMyTransactionHistory().

protected getRandomHistoricTransactionList() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRandomHolding()

Generates a random, fake holding array

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

set id

$number : string

set number for multiple items

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

Patron data

Return values
array<string|int, mixed>

getRandomItemIdentifier()

Generate an associative array containing some sort of ID (for cover generation).

protected getRandomItemIdentifier() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRandomTransactionList()

Construct a random set of transactions for getMyTransactions().

protected getRandomTransactionList() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRecordSource()

Get the name of the search backend providing records.

protected getRecordSource() : string
Return values
string

getSession()

Get the session container (constructing it on demand if not already present)

protected getSession([string $patron = null ]) : Container
Parameters
$patron : string = null

ID of current patron

Return values
Container

getSimulatedStatus()

Get Simulated Status (support method for getStatus/getHolding)

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

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

Parameters
$id : string

The record id to retrieve the holdings for

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

Patron data

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

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

getTransactionList()

Construct a transaction list for getMyTransactions; may be random or pre-set depending on Demo.ini settings.

protected getTransactionList() : array<string|int, mixed>
Return values
array<string|int, mixed>

isFailing()

Check for a simulated failure. Returns true for failure, false for success.

protected isFailing(string $method, int $default) : bool
Parameters
$method : string

Name of method that might fail

$default : int

Default probability (if config is empty)

Return values
bool

setStatus()

Set Status

protected setStatus(string $id[, array<string|int, mixed> $holding = [] ][, bool $append = true ][, array<string|int, mixed> $patron = null ]) : array<string|int, mixed>
Parameters
$id : string

id for record

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

associative array with options to specify number, barcode, availability, status, location, reserve, callnumber, duedate, is_holdable, and addLink

$append : bool = true

add another record or replace current record

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

Patron data

Return values
array<string|int, mixed>

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

Search results