ILSMockTrait
Support trait for MultiBackend ILS driver test
Tags
Table of Contents
- 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
- 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.
- getDefaultPickUpLocation() : false|string
- Get Default Pick Up Location
- getDefaultRequestGroup() : false|string
- Get Default Request Group
- getILLPickUpLibraries() : bool|array<string|int, mixed>
- Get ILL Pickup Libraries
- getILLPickUpLocations() : bool|array<string|int, mixed>
- Get ILL Pickup Locations
- getMyILLRequests() : mixed
- Get Patron ILL Requests
- getPickUpLocations() : array<string|int, mixed>
- Get Pick Up Locations
- 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
- loginIsHidden() : bool
- Is login disabled?
- placeHold() : mixed
- Place Hold
- placeILLRequest() : mixed
- Place ILL Request
- placeStorageRetrievalRequest() : mixed
- Place a Storage Retrieval Request
- renewMyItems() : array<string|int, mixed>
- Renew My Items
Methods
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
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
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
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
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
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
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.
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
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
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
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
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
Return values
array<string|int, mixed> —An array with key-value pairs.
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
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
Return values
false|string —The default request group for the patron.
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
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
Return values
bool|array<string|int, mixed> —False if request not allowed, or an array of locations.
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
Return values
mixed —Array of the patron's ILL requests
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
Return values
array<string|int, mixed> —An array of associative arrays with locationID and locationDisplay keys
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
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
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
Return values
array<string|int, mixed> —False if request groups not in use or an array of associative arrays with id and name keys
loginIsHidden()
Is login disabled?
public
loginIsHidden() : bool
Return values
bool —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
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
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
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
Return values
array<string|int, mixed> —An array of renewal information keyed by item ID