VuFind API Documentation

PAIA extends DAIA
in package

PAIA ILS Driver for VuFind to get patron information

Holding information is obtained by DAIA, so it's not necessary to implement those functions here; we just need to extend the DAIA driver.

Tags
category

VuFind

author

Oliver Goldschmidt o.goldschmidt@tuhh.de

author

Magdalena Roos roos@gbv.de

author

Till Kinstler kinstler@gbv.de

author

André Lahmann lahmann@ub.uni-leipzig.de

license

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

link

Wiki

Table of Contents

SCOPE_CHANGE_PASSWORD  = 'change_password'
SCOPE_DELETE_NOTIFICATIONS  = 'delete_notifications'
SCOPE_READ_FEES  = 'read_fees'
SCOPE_READ_ITEMS  = 'read_items'
SCOPE_READ_NOTIFICATIONS  = 'read_notifications'
SCOPE_READ_PATRON  = 'read_patron'
PAIA scopes as defined in http://gbv.github.io/paia/paia.html#access-tokens-and-scopes
SCOPE_UPDATE_PATRON  = 'update_patron'
SCOPE_UPDATE_PATRON_ADDRESS  = 'update_patron_address'
SCOPE_UPDATE_PATRON_EMAIL  = 'update_patron_email'
SCOPE_UPDATE_PATRON_NAME  = 'update_patron_name'
SCOPE_WRITE_ITEMS  = 'write_items'
$accountBlockNotificationsForMissingScopes  : array<string|int, mixed>
Account blocks that should be reported to the user.
$baseUrl  : string
Base URL for DAIA Service
$cache  : StorageInterface
Cache for storing data temporarily (e.g. patron blocks with the ILS driver)
$cacheLifetime  : int
Lifetime of cache (in seconds).
$config  : array<string|int, mixed>
Driver configuration
$contentTypesRequest  : array<string|int, mixed>
ContentTypes to use in DAIA HTTP requests in HTTP header
$contentTypesResponse  : array<string|int, mixed>
Acceptable ContentTypes delivered by DAIA server in HTTP header
$daiaCacheEnabled  : bool
Flag to switch on/off caching for DAIA items
$daiaIdPrefix  : string
DAIA query identifier prefix
$daiaResponseFormat  : string
DAIA response format
$daiaTimeout  : string
Timeout in seconds to be used for DAIA http requests
$dateConverter  : Converter
Date converter object
$grantType  : string
Accepted grant_type for authorization
$multiQuery  : bool
Flag to enable multiple DAIA-queries
$paiaCacheEnabled  : bool
Flag to switch on/off caching for PAIA items
$paiaTimeout  : int
Timeout in seconds to be used for PAIA http requests
$paiaURL  : string
URL of PAIA service
$session  : Container
Session containing PAIA login information
$sessionManager  : SessionManager
SessionManager
$statusStrings  : array<string|int, mixed>
PAIA status strings
__construct()  : mixed
Constructor
cancelHolds()  : array<string|int, mixed>
This method cancels a list of holds for a specific patron.
cancelILLRequests()  : array<string|int, mixed>
Cancel ILL Request
cancelStorageRetrievalRequests()  : array<string|int, mixed>
Cancel Storage Retrieval Request
changePassword()  : array<string|int, mixed>
Public Function which changes the password in the library system (not supported prior to VuFind 2.4)
checkILLRequestIsValid()  : bool
Check if ILL request available
checkRequestIsValid()  : bool
Check if hold or recall available
checkStorageRetrievalRequestIsValid()  : bool
Check if storage retrieval request available
getAccountBlocks()  : mixed
Check whether the patron has any blocks on their account.
getCancelHoldDetails()  : string
This method returns a string to use as the input form value for cancelling each hold item. (optional, but required if you implement cancelHolds). Not supported prior to VuFind 1.2
getCancelILLRequestDetails()  : string
Get Cancel ILL Request Details
getCancelStorageRetrievalRequestDetails()  : string
Get Cancel Storage Retrieval Request Details
getConfig()  : array<string|int, mixed>
Public Function which retrieves renew, hold and cancel settings from the driver ini file.
getDefaultPickUpLocation()  : string
Get Default Pick Up Location
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
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()  : array<string|int, mixed>
Get Patron StorageRetrievalRequests
getMyTransactions()  : array<string|int, mixed>
Get Patron Transactions
getNewItems()  : array<string|int, mixed>
This method queries the ILS for new items
getPickUpLocations()  : array<string|int, mixed>
Get Pick Up Locations
getPurchaseHistory()  : array<string|int, mixed>
Get Purchase History
getRenewDetails()  : string
This method returns a string to use as the input form value for renewing each hold item. (optional, but required if you implement the renewMyItems method) Not supported prior to VuFind 1.2
getStatus()  : mixed
Get Status
getStatuses()  : array<string|int, mixed>
Get Statuses
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
renewMyItems()  : array<string|int, mixed>
This method renews a list of items for a specific patron.
setCacheStorage()  : void
Set a cache storage object.
setConfig()  : void
Set configuration.
checkIsRecallable()  : bool
Helper function to determine if item is recallable.
checkIsStorageRetrievalRequest()  : bool
Helper function to determine if the item is available as storage retrieval.
convertDaiaXmlToJson()  : mixed
Converts a DAIA XML response to an array identical with a DAIA JSON response for the sent query.
convertDate()  : string
Support method to handle date uniformly
convertDatetime()  : string
Support method to handle datetime uniformly
debug()  : void
Log a debug message.
doHTTPRequest()  : xml
Perform an HTTP request.
enrichNotifications()  : array<string|int, mixed>
Enriches PAIA notifications response with additional mappings
enrichUserDetails()  : mixed
PAIA helper function to map session data to return value of patronLogin()
extractDaiaDoc()  : array<string|int, mixed>|DOMNode|null
Extract a DAIA document identified by an id
generateMultiURIs()  : string
Combine several ids to DAIA Query API conform URIs
generateURI()  : string
Generate a DAIA URI necessary for the query
getAdditionalFeeData()  : array<string|int, mixed>
Gets additional array fields for the item.
getAlternativeItemId()  : string
PAIA support method to retrieve needed ItemId in case PAIA-response does not contain it
getAvailableItemServices()  : array<string|int, mixed>
Returns the available services of the given set of available and unavailable services
getBasicDetails()  : array<string|int, mixed>
Map a PAIA document to an array for use in generating a VuFind request (holds, storage retrieval, etc).
getCachedData()  : mixed|null
Helper function for fetching cached data.
getCacheKey()  : string
PAIA specific override of method to ensure uniform cache keys for cached VuFind objects.
getCallNumber()  : string
Get the callnumber of this item
getConfirmations()  : array<string|int, mixed>
Returns an array with PAIA confirmations based on the given holdDetails which will be used for a request.
getCustomData()  : array<string|int, mixed>
Helper function to allow custom data in status array.
getHoldType()  : string
Helper function to determine the holdtype available for current item.
getItemBarcode()  : string
Returns the value for "location" in VuFind getStatus/getHolding array
getItemCallnumber()  : string
Returns the value for "callnumber" in VuFind getStatus/getHolding array
getItemDepartment()  : string
Returns the value of item.department.content (e.g. to be used in VuFind getStatus/getHolding array as location)
getItemDepartmentId()  : string
Returns the value of item.department.id (e.g. to be used in VuFind getStatus/getHolding array as location)
getItemDepartmentLink()  : string
Returns the value of item.department.href (e.g. to be used in VuFind getStatus/getHolding array for linking the location)
getItemLimitation()  : array<string|int, mixed>
Returns the evaluated value of the provided limitation element
getItemLimitationContent()  : array<string|int, mixed>
Returns the evaluated values of the provided limitations element
getItemLimitationTypes()  : array<string|int, mixed>
Returns the evaluated values of the provided limitations element
getItemNumber()  : mixed
Returns the value for "number" in VuFind getStatus/getHolding array
getItemReserveStatus()  : string
Returns the value for "reserve" in VuFind getStatus/getHolding array
getItemStatus()  : array<string|int, mixed>
Returns an array with status information for provided item.
getItemStorage()  : string
Returns the value of item.storage.content (e.g. to be used in VuFind getStatus/getHolding array as location)
getItemStorageId()  : string
Returns the value of item.storage.id (e.g. to be used in VuFind getStatus/getHolding array as location)
getItemStorageLink()  : string
Returns the value of item.storage.href (e.g. to be used in VuFind getStatus/getHolding array for linking the location)
getPaiaNotificationsId()  : string
Get notification identifier from message identifier
getReadableGroupType()  : string
Get Readable Group Type
getScope()  : array<string|int, mixed>
Get the session scope
getSession()  : SessionContainer
Get the session container (constructing it on demand if not already present)
getStatusString()  : string
Helper function to return an appropriate status string for current item.
log()  : void
Send a message to the logger.
logError()  : void
Log an error message.
logMessages()  : void
Logs content of message elements in DAIA response for debugging
logWarning()  : void
Log a warning message.
mapPaiaItems()  : array<string|int, mixed>
PAIA helper function to allow customization of mapping from PAIA response to VuFind ILS-method return values.
myHoldsMapping()  : array<string|int, mixed>
This PAIA helper function allows custom overrides for mapping of PAIA response to getMyHolds data structure.
myStorageRetrievalRequestsMapping()  : array<string|int, mixed>
This PAIA helper function allows custom overrides for mapping of PAIA response to getMyStorageRetrievalRequests data structure.
myTransactionsMapping()  : array<string|int, mixed>
This PAIA helper function allows custom overrides for mapping of PAIA response to getMyTransactions data structure.
paiaCheckScope()  : bool
Checks if the current scope is set for active session.
paiaDeleteRequest()  : bool|string
DELETE data on foreign host
paiaGetAsArray()  : array<string|int, mixed>|mixed
Retrieve file at given URL and return it as json_decoded array
paiaGetItems()  : array<string|int, mixed>|mixed
PAIA support method for PAIA core method 'items' returning only those documents containing the given service status.
paiaGetRequest()  : bool|string
GET data from foreign host
paiaGetSystemMessages()  : array<string|int, mixed>|mixed
PAIA support method for PAIA core method 'notifications'
paiaGetUserDetails()  : array<string|int, mixed>
Support method for paiaLogin() -- load user details into session and return array of basic user data.
paiaHandleErrors()  : void
Handle PAIA request errors and throw appropriate exception.
paiaLogin()  : mixed
PAIA authentication function
paiaParseJsonAsArray()  : mixed
Helper function for PAIA to uniformly parse JSON
paiaParseUserDetails()  : array<string|int, mixed>
PAIA support function to implement ILS specific parsing of user_details
paiaPostAsArray()  : array<string|int, mixed>|mixed
Post something at given URL and return it as json_decoded array
paiaPostRequest()  : string
Post something to a foreign host
paiaRemoveSystemMessage()  : array<string|int, mixed>|mixed
PAIA support method for PAIA core method DELETE 'notifications'
paiaRemoveSystemMessages()  : bool
Removes multiple System Messages. Bulk deletion is not implemented in PAIA, so this method iterates over the set of IDs and removes them separately
paiaStatusString()  : string
PAIA support method to return strings for PAIA service status values
parseDaiaArray()  : array<string|int, mixed>
Parse an array with DAIA status information.
parseDaiaDoc()  : array<string|int, mixed>
Parse a DAIA document depending on its type.
putCachedData()  : void
Helper function for storing cached data.
removeCachedData()  : void
Helper function for removing cached data.
throwAsIlsException()  : never
Rethrow the provided exception as an ILS exception.

Constants

SCOPE_CHANGE_PASSWORD

public mixed SCOPE_CHANGE_PASSWORD = 'change_password'

SCOPE_DELETE_NOTIFICATIONS

public mixed SCOPE_DELETE_NOTIFICATIONS = 'delete_notifications'

SCOPE_READ_FEES

public mixed SCOPE_READ_FEES = 'read_fees'

SCOPE_READ_ITEMS

public mixed SCOPE_READ_ITEMS = 'read_items'

SCOPE_READ_NOTIFICATIONS

public mixed SCOPE_READ_NOTIFICATIONS = 'read_notifications'

SCOPE_READ_PATRON

PAIA scopes as defined in http://gbv.github.io/paia/paia.html#access-tokens-and-scopes

public mixed SCOPE_READ_PATRON = 'read_patron'

Notice: logged in users should ALWAYS have scope read_patron as the PAIA driver performs paiaGetUserDetails() upon each call of VuFind's patronLogin(). That means if paiaGetUserDetails() fails (which is the case if the patron has NOT the scope read_patron) the patronLogin() will fail as well even though paiaLogin() might have succeeded. Any other scope not being available for the patron will be handled more or less gracefully through exception handling.

SCOPE_UPDATE_PATRON

public mixed SCOPE_UPDATE_PATRON = 'update_patron'

SCOPE_UPDATE_PATRON_ADDRESS

public mixed SCOPE_UPDATE_PATRON_ADDRESS = 'update_patron_address'

SCOPE_UPDATE_PATRON_EMAIL

public mixed SCOPE_UPDATE_PATRON_EMAIL = 'update_patron_email'

SCOPE_UPDATE_PATRON_NAME

public mixed SCOPE_UPDATE_PATRON_NAME = 'update_patron_name'

SCOPE_WRITE_ITEMS

public mixed SCOPE_WRITE_ITEMS = 'write_items'

Properties

$accountBlockNotificationsForMissingScopes

Account blocks that should be reported to the user.

protected array<string|int, mixed> $accountBlockNotificationsForMissingScopes
Tags
see
method

getAccountBlocks

$baseUrl

Base URL for DAIA Service

protected string $baseUrl

$cache

Cache for storing data temporarily (e.g. patron blocks with the ILS driver)

protected StorageInterface $cache = null

$cacheLifetime

Lifetime of cache (in seconds).

protected int $cacheLifetime = 30

$config

Driver configuration

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

$contentTypesRequest

ContentTypes to use in DAIA HTTP requests in HTTP header

protected array<string|int, mixed> $contentTypesRequest = ['xml' => 'application/xml', 'json' => 'application/json']

$contentTypesResponse

Acceptable ContentTypes delivered by DAIA server in HTTP header

protected array<string|int, mixed> $contentTypesResponse

$daiaCacheEnabled

Flag to switch on/off caching for DAIA items

protected bool $daiaCacheEnabled = false

$daiaIdPrefix

DAIA query identifier prefix

protected string $daiaIdPrefix

$daiaResponseFormat

DAIA response format

protected string $daiaResponseFormat

$daiaTimeout

Timeout in seconds to be used for DAIA http requests

protected string $daiaTimeout = null

$dateConverter

Date converter object

protected Converter $dateConverter

$grantType

Accepted grant_type for authorization

protected string $grantType = 'password'

$multiQuery

Flag to enable multiple DAIA-queries

protected bool $multiQuery = false

$paiaCacheEnabled

Flag to switch on/off caching for PAIA items

protected bool $paiaCacheEnabled = false

$paiaTimeout

Timeout in seconds to be used for PAIA http requests

protected int $paiaTimeout = null

$paiaURL

URL of PAIA service

protected string $paiaURL

$session

Session containing PAIA login information

protected Container $session

$sessionManager

SessionManager

protected SessionManager $sessionManager

$statusStrings

PAIA status strings

protected static array<string|int, mixed> $statusStrings = ['0' => 'no relation', '1' => 'reserved', '2' => 'ordered', '3' => 'held', '4' => 'provided', '5' => 'rejected']

Methods

__construct()

Constructor

public __construct(Converter $converter, SessionManager $sessionManager) : mixed
Parameters
$converter : Converter

Date converter

$sessionManager : SessionManager

Session Manager

Return values
mixed

cancelHolds()

This method cancels a list of holds for a specific patron.

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 details an array of strings returned by the driver's getCancelHoldDetails method

Return values
array<string|int, mixed>

Associative array containing: count The number of items successfully cancelled items Associative array where key matches one of the item_id values returned by getMyHolds and the value is an associative array with these keys: success Boolean true or false status A status message from the language file (required – VuFind-specific message, subject to translation) sysMessage A system supplied failure message

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()

Public Function which changes the password in the library system (not supported prior to VuFind 2.4)

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

Array with patron information, newPassword and oldPassword.

Return values
array<string|int, mixed>

An array with patron information.

checkILLRequestIsValid()

Check if ILL request available

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

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
bool

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

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
bool

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

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
bool

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
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()

This method returns a string to use as the input form value for cancelling each hold item. (optional, but required if you implement cancelHolds). Not supported prior to VuFind 1.2

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

A single hold array from getMyHolds

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

Patron information from patronLogin

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
string

A string to use as the input form value for cancelling each hold item; you can pass any data that is needed by your ILS to identify the hold – the output of this method will be used as part of the input to the cancelHolds method.

getCancelILLRequestDetails()

Get Cancel ILL Request Details

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

An array of item 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> $details, 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
$details : array<string|int, mixed>

An array of item 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 retrieves renew, hold and cancel settings from the driver ini file.

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.

getDefaultPickUpLocation()

Get Default Pick Up Location

public getDefaultPickUpLocation([array<string|int, mixed> $patron = null ][, array<string|int, mixed> $holdDetails = null ]) : string
Parameters
$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 pickup options or may be ignored.

Return values
string

The default pickup location for the patron.

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.

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
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 $id, 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
$id : 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.

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

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

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 StorageRetrievalRequests

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

This is responsible for retrieving all storage retrieval requests 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 on success,

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

Return values
array<string|int, mixed>

Array of the patron's transactions on success,

getNewItems()

This method queries the ILS for new items

public getNewItems(string $page, string $limit, string $daysOld, string $fundID) : array<string|int, mixed>
Parameters
$page : string

page number of results to retrieve (counting starts @1)

$limit : string

the size of each page of results to retrieve

$daysOld : string

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

$fundID : string

optional fund ID to use for limiting results

Return values
array<string|int, mixed>

An associative array with two keys: 'count' (the number of items in the 'results' array) and 'results' (an array of associative arrays, each with a single key: 'id', a record ID).

getPickUpLocations()

Get Pick Up Locations

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

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

Parameters
$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 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.

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.

getRenewDetails()

This method returns a string to use as the input form value for renewing each hold item. (optional, but required if you implement the renewMyItems method) Not supported prior to VuFind 1.2

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

One of the individual item arrays returned by the getMyTransactions method

Return values
string

A string to use as the input form value for renewing each item; you can pass any data that is needed by your ILS to identify the transaction to renew – the output of this method will be used as part of the input to the renewMyItems method.

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. As the DAIA Query API supports querying multiple ids simultaneously (all ids divided by "|") getStatuses(ids) would call getStatus(id) only once, id containing the list of ids to be retrieved. This would cause some trouble as the list of ids does not necessarily correspond to the VuFind Record-id. Therefore getStatuses(ids) has its own logic for multiQuery-support and performs the HTTPRequest itself, retrieving one DAIA response for all ids and uses helper functions to split this one response into documents corresponding to the queried ids.

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 status information values on success.

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's username

$password : string

The patron's login 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

Make a request on a specific record

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)

renewMyItems()

This method renews a list of items for a specific patron.

public renewMyItems(array<string|int, mixed> $details) : array<string|int, mixed>
Parameters
$details : array<string|int, mixed>
  • An associative array with two keys: patron - array returned by patronLogin method details - array of values returned by the getRenewDetails method identifying which items to renew
Return values
array<string|int, mixed>
  • An associative array with two keys: blocks - An array of strings specifying why a user is blocked from renewing (false if no blocks) details - Not set when blocks exist; otherwise, an array of associative arrays (keyed by item ID) with each subarray containing these keys: success – Boolean true or false new_date – string – A new due date new_time – string – A new due time item_id – The item id of the renewed item sysMessage – A system supplied renewal message (optional)

setCacheStorage()

Set a cache storage object.

public setCacheStorage([StorageInterface $cache = null ]) : void
Parameters
$cache : StorageInterface = null

Cache storage interface

Return values
void

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

checkIsRecallable()

Helper function to determine if item is recallable.

protected checkIsRecallable(array<string|int, mixed> $item) : bool

DAIA does not genuinly allow distinguishing between holdable and recallable items. This could be achieved by usage of limitations but this would not be shared functionality between different DAIA implementations (thus should be implemented in custom drivers). Therefore this returns whether an item is recallable based on unavailable services and the existence of an href.

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

Array with DAIA item data

Return values
bool

checkIsStorageRetrievalRequest()

Helper function to determine if the item is available as storage retrieval.

protected checkIsStorageRetrievalRequest(array<string|int, mixed> $item) : bool
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
bool

convertDaiaXmlToJson()

Converts a DAIA XML response to an array identical with a DAIA JSON response for the sent query.

protected convertDaiaXmlToJson(string $daiaResponse) : mixed
Parameters
$daiaResponse : string

Response in XML format from DAIA service

Return values
mixed

convertDate()

Support method to handle date uniformly

protected convertDate(string $date) : string
Parameters
$date : string

String representing a date

Return values
string

Formatted date

convertDatetime()

Support method to handle datetime uniformly

protected convertDatetime(string $datetime) : string
Parameters
$datetime : string

String representing a datetime

Return values
string

Formatted datetime

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

doHTTPRequest()

Perform an HTTP request.

protected doHTTPRequest(string $id) : xml
Parameters
$id : string

id for query in daia

Tags
throws
ILS
Return values
xml

or json object

enrichNotifications()

Enriches PAIA notifications response with additional mappings

protected enrichNotifications(array<string|int, mixed> $notifications) : array<string|int, mixed>
Parameters
$notifications : array<string|int, mixed>

list of PAIA notifications

Return values
array<string|int, mixed>

list of enriched PAIA notifications

enrichUserDetails()

PAIA helper function to map session data to return value of patronLogin()

protected enrichUserDetails(array<string|int, mixed> $details, string $password) : mixed
Parameters
$details : array<string|int, mixed>

Patron details returned by patronLogin

$password : string

Patron catalogue password

Return values
mixed

extractDaiaDoc()

Extract a DAIA document identified by an id

protected extractDaiaDoc(string $id, string $daiaResponse) : array<string|int, mixed>|DOMNode|null

This method loops through all the existing DAIA document-elements in the given DAIA response and returns the first document whose id matches the given id.

Parameters
$id : string

Record Id of the DAIA document in question.

$daiaResponse : string

Raw response from DAIA request.

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

The DAIA document identified by id and type depending on daiaResponseFormat.

generateMultiURIs()

Combine several ids to DAIA Query API conform URIs

protected generateMultiURIs(array<string|int, mixed> $ids) : string
Parameters
$ids : array<string|int, mixed>

Array of ids which shall be converted into URIs and combined for querying multiple DAIA documents.

Tags
see
http://gbv.github.io/daia/daia.html#query-parameters
Return values
string

Combined URIs (delimited by "|")

generateURI()

Generate a DAIA URI necessary for the query

protected generateURI(string $id) : string
Parameters
$id : string

Id of the record whose DAIA document should be queried

Tags
see
http://gbv.github.io/daia/daia.html#query-parameters
Return values
string

URI of the DAIA document

getAdditionalFeeData()

Gets additional array fields for the item.

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

Override this method in your custom PAIA driver if necessary.

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

The fee array from PAIA

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

The patron array from patronLogin

Return values
array<string|int, mixed>

Additional fee data for the item

getAlternativeItemId()

PAIA support method to retrieve needed ItemId in case PAIA-response does not contain it

protected getAlternativeItemId(string $id) : string
Parameters
$id : string

itemId

Return values
string

$id

getAvailableItemServices()

Returns the available services of the given set of available and unavailable services

protected getAvailableItemServices(array<string|int, mixed> $services) : array<string|int, mixed>
Parameters
$services : array<string|int, mixed>

Array with DAIA services available/unavailable

Return values
array<string|int, mixed>

getBasicDetails()

Map a PAIA document to an array for use in generating a VuFind request (holds, storage retrieval, etc).

protected getBasicDetails(array<string|int, mixed> $doc) : array<string|int, mixed>
Parameters
$doc : array<string|int, mixed>

Array of PAIA document to be mapped.

Return values
array<string|int, mixed>

getCachedData()

Helper function for fetching cached data.

protected getCachedData(string $key) : mixed|null

Data is cached for up to $this->cacheLifetime.

Parameters
$key : string

Cache entry key

Return values
mixed|null

Cached entry or null if not cached or expired

getCacheKey()

PAIA specific override of method to ensure uniform cache keys for cached VuFind objects.

protected getCacheKey([string|null $suffix = null ]) : string
Parameters
$suffix : string|null = null

Optional suffix that will get appended to the object class name calling getCacheKey()

Return values
string

getCallNumber()

Get the callnumber of this item

protected getCallNumber(array<string|int, mixed> $doc) : string
Parameters
$doc : array<string|int, mixed>

Array of PAIA item.

Return values
string

getConfirmations()

Returns an array with PAIA confirmations based on the given holdDetails which will be used for a request.

protected getConfirmations(array<string|int, mixed> $holdDetails) : array<string|int, mixed>

Currently two condition types are supported:

  • http://purl.org/ontology/paia#StorageCondition to select a document location -- mapped to pickUpLocation
  • http://purl.org/ontology/paia#FeeCondition to confirm or select a document service causing a fee -- not mapped yet
Parameters
$holdDetails : array<string|int, mixed>

An array of item and patron data

Return values
array<string|int, mixed>

getCustomData()

Helper function to allow custom data in status array.

protected getCustomData(array<string|int, mixed> $item) : array<string|int, mixed>
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
array<string|int, mixed>

getHoldType()

Helper function to determine the holdtype available for current item.

protected getHoldType(array<string|int, mixed> $item) : string

DAIA does not genuinly allow distinguishing between holdable and recallable items. This could be achieved by usage of limitations but this would not be shared functionality between different DAIA implementations (thus should be implemented in custom drivers). Therefore getHoldType always returns recall.

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

Array with DAIA item data

Return values
string

'recall'|null

getItemBarcode()

Returns the value for "location" in VuFind getStatus/getHolding array

protected getItemBarcode(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

getItemCallnumber()

Returns the value for "callnumber" in VuFind getStatus/getHolding array

protected getItemCallnumber(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

getItemDepartment()

Returns the value of item.department.content (e.g. to be used in VuFind getStatus/getHolding array as location)

protected getItemDepartment(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

getItemDepartmentId()

Returns the value of item.department.id (e.g. to be used in VuFind getStatus/getHolding array as location)

protected getItemDepartmentId(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

Returns the value of item.department.href (e.g. to be used in VuFind getStatus/getHolding array for linking the location)

protected getItemDepartmentLink(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

getItemLimitation()

Returns the evaluated value of the provided limitation element

protected getItemLimitation(array<string|int, mixed> $limitations) : array<string|int, mixed>
Parameters
$limitations : array<string|int, mixed>

Array with DAIA limitation data

Return values
array<string|int, mixed>

getItemLimitationContent()

Returns the evaluated values of the provided limitations element

protected getItemLimitationContent(array<string|int, mixed> $limitations) : array<string|int, mixed>
Parameters
$limitations : array<string|int, mixed>

Array with DAIA limitation data

Return values
array<string|int, mixed>

getItemLimitationTypes()

Returns the evaluated values of the provided limitations element

protected getItemLimitationTypes(array<string|int, mixed> $limitations) : array<string|int, mixed>
Parameters
$limitations : array<string|int, mixed>

Array with DAIA limitation data

Return values
array<string|int, mixed>

getItemNumber()

Returns the value for "number" in VuFind getStatus/getHolding array

protected getItemNumber(array<string|int, mixed> $item, int $counter) : mixed
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

$counter : int

Integer counting items as alternative return value

Return values
mixed

getItemReserveStatus()

Returns the value for "reserve" in VuFind getStatus/getHolding array

protected getItemReserveStatus(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

getItemStatus()

Returns an array with status information for provided item.

protected getItemStatus(array<string|int, mixed> $item) : array<string|int, mixed>
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
array<string|int, mixed>

getItemStorage()

Returns the value of item.storage.content (e.g. to be used in VuFind getStatus/getHolding array as location)

protected getItemStorage(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

getItemStorageId()

Returns the value of item.storage.id (e.g. to be used in VuFind getStatus/getHolding array as location)

protected getItemStorageId(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

Returns the value of item.storage.href (e.g. to be used in VuFind getStatus/getHolding array for linking the location)

protected getItemStorageLink(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

getPaiaNotificationsId()

Get notification identifier from message identifier

protected getPaiaNotificationsId(string $messageId) : string
Parameters
$messageId : string

Message identifier

Return values
string

getReadableGroupType()

Get Readable Group Type

protected getReadableGroupType(string $type) : string

Due to PAIA specifications type returns an URI. This method offers a possibility to translate the URI in a readable value by inheritance and implementing a personal proceeding.

Parameters
$type : string

URI of usertype

Return values
string

URI of usertype

getScope()

Get the session scope

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

Array of the Session scope

getSession()

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

protected getSession() : SessionContainer
Return values
SessionContainer

getStatusString()

Helper function to return an appropriate status string for current item.

protected getStatusString(array<string|int, mixed> $item) : string
Parameters
$item : array<string|int, mixed>

Array with DAIA item data

Return values
string

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

logMessages()

Logs content of message elements in DAIA response for debugging

protected logMessages(array<string|int, mixed> $messages, string $context) : void
Parameters
$messages : array<string|int, mixed>

Array with message elements to be logged

$context : string

Description of current message context

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

mapPaiaItems()

PAIA helper function to allow customization of mapping from PAIA response to VuFind ILS-method return values.

protected mapPaiaItems(array<string|int, mixed> $items, string $mapping) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>

Array of PAIA items to be mapped

$mapping : string

String identifying a custom mapping-method

Return values
array<string|int, mixed>

myHoldsMapping()

This PAIA helper function allows custom overrides for mapping of PAIA response to getMyHolds data structure.

protected myHoldsMapping(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>

Array of PAIA items to be mapped.

Return values
array<string|int, mixed>

myStorageRetrievalRequestsMapping()

This PAIA helper function allows custom overrides for mapping of PAIA response to getMyStorageRetrievalRequests data structure.

protected myStorageRetrievalRequestsMapping(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>

Array of PAIA items to be mapped.

Return values
array<string|int, mixed>

myTransactionsMapping()

This PAIA helper function allows custom overrides for mapping of PAIA response to getMyTransactions data structure.

protected myTransactionsMapping(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>

Array of PAIA items to be mapped.

Return values
array<string|int, mixed>

paiaCheckScope()

Checks if the current scope is set for active session.

protected paiaCheckScope(string $scope) : bool
Parameters
$scope : string

The scope to test for with the current session scopes.

Return values
bool

paiaDeleteRequest()

DELETE data on foreign host

protected paiaDeleteRequest(string $file[, string $access_token = null ]) : bool|string
Parameters
$file : string

DELETE target URL

$access_token : string = null

PAIA access token for current session

Tags
throws
ILS
Return values
bool|string

paiaGetAsArray()

Retrieve file at given URL and return it as json_decoded array

protected paiaGetAsArray(string $file) : array<string|int, mixed>|mixed
Parameters
$file : string

GET target URL

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

paiaGetItems()

PAIA support method for PAIA core method 'items' returning only those documents containing the given service status.

protected paiaGetItems(array<string|int, mixed> $patron[, array<string|int, mixed> $filter = [] ]) : array<string|int, mixed>|mixed
Parameters
$patron : array<string|int, mixed>

Array with patron information

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

Array of properties identifying the wanted items

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

Array of documents containing the given filter properties

paiaGetRequest()

GET data from foreign host

protected paiaGetRequest(string $file, string $access_token) : bool|string
Parameters
$file : string

GET target URL

$access_token : string

PAIA access token for current session

Tags
throws
ILS
Return values
bool|string

paiaGetSystemMessages()

PAIA support method for PAIA core method 'notifications'

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

Array with patron information

Tags
throws
Exception
throws
ILS

You are not entitled to read notifications

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

Array of system notifications for the patron

paiaGetUserDetails()

Support method for paiaLogin() -- load user details into session and return array of basic user data.

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

patron ID

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

paiaHandleErrors()

Handle PAIA request errors and throw appropriate exception.

protected paiaHandleErrors(array<string|int, mixed> $array) : void
Parameters
$array : array<string|int, mixed>

Array containing error messages

Tags
throws
Auth
throws
ILS
Return values
void

paiaLogin()

PAIA authentication function

protected paiaLogin(string $username, string $password) : mixed
Parameters
$username : string

Username

$password : string

Password

Tags
throws
ILS
Return values
mixed

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

paiaParseJsonAsArray()

Helper function for PAIA to uniformly parse JSON

protected paiaParseJsonAsArray(string $file) : mixed
Parameters
$file : string

JSON data

Tags
throws
Exception
Return values
mixed

paiaParseUserDetails()

PAIA support function to implement ILS specific parsing of user_details

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

User id

$user_response : array<string|int, mixed>

Array with PAIA response data

Return values
array<string|int, mixed>

paiaPostAsArray()

Post something at given URL and return it as json_decoded array

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

POST target URL

$data : array<string|int, mixed>

POST data

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

paiaPostRequest()

Post something to a foreign host

protected paiaPostRequest(string $file, string $data_to_send[, string $access_token = null ]) : string
Parameters
$file : string

POST target URL

$data_to_send : string

POST data

$access_token : string = null

PAIA access token for current session

Tags
throws
ILS
Return values
string

POST response

paiaRemoveSystemMessage()

PAIA support method for PAIA core method DELETE 'notifications'

protected paiaRemoveSystemMessage(array<string|int, mixed> $patron, string $messageId[, bool $keepCache = false ]) : array<string|int, mixed>|mixed
Parameters
$patron : array<string|int, mixed>

Array with patron information

$messageId : string

PAIA service specific ID of the notification to remove

$keepCache : bool = false

if set to TRUE the notification cache will survive the remote operation, this is used by \VuFind\ILS\Driver\PAIA::paiaRemoveSystemMessages to avoid unnecessary cache operations

Tags
throws
Exception
throws
ILS

You are not entitled to read notifications

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

Array of system notifications for the patron

paiaRemoveSystemMessages()

Removes multiple System Messages. Bulk deletion is not implemented in PAIA, so this method iterates over the set of IDs and removes them separately

protected paiaRemoveSystemMessages(array<string|int, mixed> $patron, array<string|int, mixed> $messageIds) : bool
Parameters
$patron : array<string|int, mixed>

Array with patron information

$messageIds : array<string|int, mixed>

list of PAIA service specific IDs of the notifications to remove

Tags
throws
ILS
Return values
bool

TRUE if all messages have been successfully removed, otherwise FALSE

paiaStatusString()

PAIA support method to return strings for PAIA service status values

protected paiaStatusString(string $status) : string
Parameters
$status : string

PAIA service status

Return values
string

Describing PAIA service status

parseDaiaArray()

Parse an array with DAIA status information.

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

Record id for the DAIA array.

$daiaArray : array<string|int, mixed>

Array with raw DAIA status information.

Return values
array<string|int, mixed>

Array with VuFind compatible status information.

parseDaiaDoc()

Parse a DAIA document depending on its type.

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

Parse a DAIA document depending on its type and return a VuFind compatible array of status information. Supported types are: - array (for JSON results)

Parameters
$id : string

Record Id corresponding to the DAIA document

$daiaDoc : mixed

The DAIA document, only array is supported

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

An array with status information for the record

putCachedData()

Helper function for storing cached data.

protected putCachedData(string $key, mixed $entry[, int $lifetime = null ]) : void

Data is cached for up to $this->cacheLifetime seconds.

Parameters
$key : string

Cache entry key

$entry : mixed

Entry to be cached

$lifetime : int = null

Optional lifetime for the entry in seconds

Return values
void

removeCachedData()

Helper function for removing cached data.

protected removeCachedData(string $key) : void
Parameters
$key : string

Cache entry key

Return values
void

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