VuFind API Documentation

XCNCIP2 extends AbstractBase
in package
implements HttpServiceAwareInterface, LoggerAwareInterface, TranslatorAwareInterface Uses HttpServiceAwareTrait, CacheTrait, OAuth2TokenTrait, TranslatorAwareTrait

XC NCIP Toolkit (v2) ILS Driver

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

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

link

Wiki

Interfaces, Classes, Traits and Enums

HttpServiceAwareInterface
LoggerAwareInterface
TranslatorAwareInterface
Lightweight translator aware marker interface (used as an alternative to \Laminas\I18n\Translator\TranslatorAwareInterface, which requires an excessive number of methods to be implemented).

Table of Contents

$activeRequestStatuses  : array<string|int, string>
Statuses of active requests, lowercased status strings from RequestStatusType NCIP element
$agency  : array<string|int, mixed>
Agency definitions (consortial) - Array list of consortium members
$availableStatuses  : array<string|int, string>
Statuses of available items lowercased status string from CirculationStatus NCIP element
$blockCodes  : array<string|int, mixed>
Mapping block messages from NCIP API to VuFind internal values
$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
$consortium  : bool
Is this a consortium? Default: false
$dateConverter  : Converter
Date converter object
$disableRenewals  : bool
Are renewals disabled for this driver instance? Defaults to false
$fromAgency  : string
From agency id
$holdProblemsDisplay  : array<string|int, string>
Which subelements of Problem element show to user when placing hold fails.
$holdRequestTypes  : array<string|int, string>
Lowercased request type strings identifying holds
$itemUseRestrictionTypesForStatus  : array<string|int, mixed>
Some ItemUseRestrictionType values could be useful as status. This property controls which values from ItemRestrictionType should replace the status value in response of getHolding method.
$maxNumberOfPages  : int
Max number of pages taken from API at once. Sometimes NCIP responders could paginate even if we want all data at one time. We then ask for all pages, but it could possibly lead to long response times.
$notHoldableRestriction  : array<string|int, string>
Lowercased item use restriction types we consider to be holdable
$notHoldableStatuses  : array<string|int, string>
Lowercased circulation statuses we consider not be holdable
$otherAcceptedHttpStatusCodes  : array<string|int, mixed>
Other than 2xx HTTP status codes, which could be accepted as correct response.
$password  : string
HTTP Basic password
$pathResolver  : PathResolver
Config file path resolver
$pickupLocations  : array<string|int, mixed>
Pickup locations
$requestAvailableStatus  : string
Lowercased status string for requests available for pickup by patron
$responses  : array<string|int, mixed>
L1 cache for NCIP responses to save some http connections. Responses are save as in following structure: [ 'ServiceName' => [ 'someId' => \SimpleXMLElement ] ]
$schemes  : array<string|int, string>
Schemes preset for certain elements. See implementation profile: http://www.ncip.info/uploads/7/1/4/6/7146749/z39-83-2-2012_ncip.pdf
$storageRetrievalRequestTypes  : array<string|int, string>
Lowercased request type strings identifying storage retrievals
$tokenBasicAuth  : bool
Use HTTP basic authorization when getting OAuth2 token
$translationDomain  : string
Domain used to translate messages from ILS
$translator  : TranslatorInterface
Translator
$url  : string
NCIP server URL
$useHttpBasic  : bool
If the NCIP need an authorization using HTTP Basic
$useOAuth2  : bool
If the NCIP need an authorization using OAuth2
$username  : string
HTTP Basic username
__construct()  : mixed
Constructor
cancelHolds()  : array<string|int, mixed>
Cancel Holds
cancelStorageRetrievalRequests()  : array<string|int, mixed>
Cancel Storage Retrieval Requests (Call Slips)
checkStorageRetrievalRequestIsValid()  : bool
Check if storage retrieval request available
findReserves()  : array<string|int, mixed>
Find Reserves
getAccountBlocks()  : mixed
Check whether the patron has any blocks on their account.
getCancelHoldDetails()  : string
Get Cancel Hold Details
getCancelRequestDetails()  : string
Get Cancel Request Details
getCancelStorageRetrievalRequestDetails()  : string
Get Cancel Storage Retrieval Request (Call Slip) Details
getConfig()  : array<string|int, mixed>
Public Function which retrieves Holds, StorageRetrievalRequests, and Consortial settings from the driver ini file.
getConsortialHoldings()  : array<string|int, mixed>
Get Consortial Holding
getCourses()  : array<string|int, mixed>
Get Courses
getDefaultPickUpLocation()  : string
Get Default Pick Up Location
getDepartments()  : array<string|int, mixed>
Get Departments
getFunds()  : array<string|int, mixed>
Get Funds
getHolding()  : array<string|int, mixed>
Get Holding
getInstructors()  : array<string|int, mixed>
Get Instructors
getLookupAgencyRequest()  : string
Get LookupAgency Request XML message
getMyFines()  : mixed
Get Patron Fines
getMyHolds()  : array<string|int, mixed>
Get Patron Holds
getMyProfile()  : array<string|int, mixed>
Get Patron Profile
getMyStorageRetrievalRequests()  : array<string|int, mixed>
Get Patron Storage Retrieval Requests
getMyTransactions()  : array<string|int, mixed>
Get Patron Transactions
getNewItems()  : array<string|int, mixed>
Get New Items
getNewOAuth2Token()  : AuthToken
Get new authorization token from API using given credentials
getPickUpLocations()  : array<string|int, mixed>
Get Pick Up Locations
getPurchaseHistory()  : array<string|int, mixed>
Get Purchase History
getRenewDetails()  : string
Get Renew Details
getStatus()  : mixed
Get Status
getStatuses()  : array<string|int, mixed>
Get Statuses
getSuppressedRecords()  : array<string|int, mixed>
Get suppressed records.
getTranslator()  : TranslatorInterface
Get translator object.
getTranslatorLocale()  : string
Get the locale from the translator.
handleCancelRequest()  : array<string|int, mixed>
General cancel request method
init()  : void
Initialize the driver.
loadPickUpLocations()  : void
Load pickup locations from file or from NCIP responder - it depends on configuration
loadPickUpLocationsFromNcip()  : void
Loads pickup location information from LookupAgency NCIP service.
patronLogin()  : mixed
Patron Login
placeHold()  : mixed
Place Hold
placeRequest()  : mixed
Place a general request
placeStorageRetrievalRequest()  : mixed
Place Storage Retrieval Request (Call Slip)
renewMyItems()  : array<string|int, mixed>
Renew My Items
setCacheStorage()  : void
Set a cache storage object.
setConfig()  : void
Set configuration.
setTranslator()  : TranslatorAwareInterface
Set a translator
translate()  : string
Translate a string (or string-castable object)
translateWithPrefix()  : string
Translate a string (or string-castable object) using a prefix, or without the prefix if a prefixed translation is not found.
checkRequestType()  : bool
Is request of desired type?
checkResponseForError()  : void
Throw an exception if an NCIP error is found
convertDateOrTime()  : string
Convert datetime to display format
determineToAgencyId()  : string|null
Determine ToAgencyId
displayDate()  : string
Convert a date to display format
displayTime()  : string
Convert a time to display format
element()  : string
Creates simple element as XML string
extractTextDomain()  : array<string|int, mixed>
Given a translation string with or without a text domain, return an array with the raw string and the text domain separated.
getAuthenticationInputXml()  : string
Get XML string for AuthenticationInput element
getBibliographicId()  : string
Get BibliographicId element
getBibs()  : array<string|int, SimpleXMLElement>
Get all bibliographic records
getCachedData()  : mixed|null
Helper function for fetching cached data.
getCacheKey()  : string
Method to ensure uniform cache keys for cached VuFind objects.
getCancelRequest()  : string
Helper function to build the request XML to cancel a request:
getDebugTranslation()  : string
Build a debug-mode translation
getHoldingsForChunk()  : array<string|int, mixed>
Given a chunk of the availability response, extract the values needed by VuFind.
getHoldType()  : string
Get Hold Type
getInitiationHeaderXml()  : string
Get InitiationHeader element XML string
getItemIdXml()  : string
Get ItemId element XML
getLookupItemRequest()  : string
Create Lookup Item Request
getLookupUserExtras()  : array<string|int, mixed>
Creates array for Lookup user desired information
getLookupUserRequest()  : string
Helper function to build the request XML to log in a user and/or retrieve loaned items / request information
getLookupUserResponse()  : SimpleXMLElement
Get Lookup user response
getMyRequests()  : array<string|int, mixed>
Get Patron requests by type
getNCIPMessageStart()  : string
Helper method for creating XML header and main element start
getOAuth2Token()  : string
Get a new or cached OAuth2 token (type + token)
getPatronBlocks()  : array<string|int, mixed>
Return patron blocks
getProblemDescription()  : string
Get problem description as one string
getRenewRequest()  : string
Helper function to build the request XML to renew an item:
getRequest()  : string
Helper function to build the request XML to request an item (Hold, Storage Retrieval, etc)
getRequestTypeXml()  : string
Get request type elements XML
getStatusForChunk()  : array<string|int, mixed>
Given a chunk of the availability response, extract the values needed by VuFind.
getStatusRequest()  : string
Build NCIP2 request XML for item status information.
getUserIdXml()  : string
Get UserId element XML
invalidateResponseCache()  : void
Invalidate L1 cache for responses
isAvailable()  : bool
Is an item available?
isItemHoldable()  : bool
Check if item is holdable
isNextItemTokenEmpty()  : bool
Check NextItemToken for emptiness
isPatronBlocked()  : bool
Helper function to distinguish if blocks are really blocking patron from actions on ILS, or if they are more like notifies
isRequestCancelled()  : bool
Is request cancelled?
loadPickUpLocationsFromFile()  : void
Loads pickup location information from configuration file.
parseLocationInstance()  : array<string|int, mixed>
Parse the LocationNameInstanceElement for multi-level locations
parseProblem()  : string
Parse all reported problem and return its string representation
parseXml()  : SimpleXMLElement
Parse http response into XML object representation
putCachedData()  : void
Helper function for storing cached data.
registerNamespaceFor()  : void
Register namespace(s) for an XML element/tree
removeCachedData()  : void
Helper function for removing cached data.
sanitizeTranslationKey()  : string
Make sure there are not any illegal characters in the translation key that might prevent successful lookup in language files.
schemeAttr()  : string
Creates scheme attribute based on $this->schemes array
sendRequest()  : SimpleXMLElement
Send an NCIP request.
throwAsIlsException()  : never
Rethrow the provided exception as an ILS exception.
translateMessage()  : string
Translate a message from ILS
translateString()  : string
Get translation for a string

Properties

$activeRequestStatuses

Statuses of active requests, lowercased status strings from RequestStatusType NCIP element

protected array<string|int, string> $activeRequestStatuses = ['available for pickup', 'in process']

$agency

Agency definitions (consortial) - Array list of consortium members

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

$availableStatuses

Statuses of available items lowercased status string from CirculationStatus NCIP element

protected array<string|int, string> $availableStatuses = ['not charged', 'available on shelf']

$blockCodes

Mapping block messages from NCIP API to VuFind internal values

protected array<string|int, mixed> $blockCodes = ['Block Check Out' => 'checkout_block', 'Block Electronic Resource Access' => 'electronic_resources_block', 'Block Hold' => 'requests_blocked', 'Block Recall' => 'requests_blocked', 'Block Renewal' => 'renewal_block', 'Block Request Item' => 'requests_blocked', 'Trap For Lost Card' => 'lost_card', 'Trap For Message' => 'message_from_library', 'Trap For Pickup' => 'available_for_pickup_notification']

$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 = []

$consortium

Is this a consortium? Default: false

protected bool $consortium = false

$dateConverter

Date converter object

protected Converter $dateConverter

$disableRenewals

Are renewals disabled for this driver instance? Defaults to false

protected bool $disableRenewals = false

$fromAgency

From agency id

protected string $fromAgency = null

$holdProblemsDisplay

Which subelements of Problem element show to user when placing hold fails.

protected array<string|int, string> $holdProblemsDisplay = ['ProblemType']

Possible values are: 'ProblemType', 'ProblemDetail', 'ProblemElement', 'ProblemValue'

$holdRequestTypes

Lowercased request type strings identifying holds

protected array<string|int, string> $holdRequestTypes = ['hold', 'recall']

$itemUseRestrictionTypesForStatus

Some ItemUseRestrictionType values could be useful as status. This property controls which values from ItemRestrictionType should replace the status value in response of getHolding method.

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

$maxNumberOfPages

Max number of pages taken from API at once. Sometimes NCIP responders could paginate even if we want all data at one time. We then ask for all pages, but it could possibly lead to long response times.

protected int $maxNumberOfPages

$notHoldableRestriction

Lowercased item use restriction types we consider to be holdable

protected array<string|int, string> $notHoldableRestriction = ['not for loan']

$notHoldableStatuses

Lowercased circulation statuses we consider not be holdable

protected array<string|int, string> $notHoldableStatuses = ['circulation status undefined', 'not available', 'lost']

$otherAcceptedHttpStatusCodes

Other than 2xx HTTP status codes, which could be accepted as correct response.

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

Some NCIP servers could return some 4xx codes similar to REST API (like 404 Not found) altogether with correct XML in response body.

$password

HTTP Basic password

protected string $password

$pickupLocations

Pickup locations

protected array<string|int, mixed> $pickupLocations = null

$requestAvailableStatus

Lowercased status string for requests available for pickup by patron

protected string $requestAvailableStatus = 'available for pickup'

$responses

L1 cache for NCIP responses to save some http connections. Responses are save as in following structure: [ 'ServiceName' => [ 'someId' => \SimpleXMLElement ] ]

protected array<string|int, mixed> $responses = ['LookupUser' => []]

$schemes

Schemes preset for certain elements. See implementation profile: http://www.ncip.info/uploads/7/1/4/6/7146749/z39-83-2-2012_ncip.pdf

protected array<string|int, string> $schemes = ['AgencyElementType' => 'http://www.niso.org/ncip/v1_0/imp1/schemes/agencyelementtype/' . 'agencyelementtype.scm', 'AuthenticationDataFormatType' => 'http://www.iana.org/assignments/media-types/', 'AuthenticationInputType' => 'http://www.niso.org/ncip/v1_0/imp1/schemes/authenticationinputtype/' . 'authenticationinputype.scm', 'BibliographicItemIdentifierCode' => 'http://www.niso.org/ncip/v1_0/imp1/schemes/' . 'bibliographicitemidentifiercode/bibliographicitemidentifiercode.scm', 'ItemElementType' => 'http://www.niso.org/ncip/v1_0/schemes/itemelementtype/' . 'itemelementtype.scm', 'RequestScopeType' => 'http://www.niso.org/ncip/v1_0/imp1/schemes/requestscopetype/' . 'requestscopetype.scm', 'RequestType' => 'http://www.niso.org/ncip/v1_0/imp1/schemes/requesttype/requesttype.scm', 'UserElementType' => 'http://www.niso.org/ncip/v1_0/schemes/userelementtype/' . 'userelementtype.scm']

$storageRetrievalRequestTypes

Lowercased request type strings identifying storage retrievals

protected array<string|int, string> $storageRetrievalRequestTypes = ['stack retrieval']

$tokenBasicAuth

Use HTTP basic authorization when getting OAuth2 token

protected bool $tokenBasicAuth = false

$translationDomain

Domain used to translate messages from ILS

protected string $translationDomain = 'ILSMessages'

$url

NCIP server URL

protected string $url

$useHttpBasic

If the NCIP need an authorization using HTTP Basic

protected bool $useHttpBasic = false

$useOAuth2

If the NCIP need an authorization using OAuth2

protected bool $useOAuth2 = false

$username

HTTP Basic username

protected string $username

Methods

__construct()

Constructor

public __construct(Converter $dateConverter[, PathResolver $pathResolver = null ]) : mixed
Parameters
$dateConverter : Converter

Date converter object

$pathResolver : PathResolver = null

Config file path resolver

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. The data in $cancelDetails['details'] is determined by getCancelHoldDetails().

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.

cancelStorageRetrievalRequests()

Cancel Storage Retrieval Requests (Call Slips)

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

Attempts to Cancel a call slip 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.

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

findReserves()

Find Reserves

public findReserves(string $course, string $inst, string $dept) : array<string|int, 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
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array of associative arrays representing reserve items.

getAccountBlocks()

Check whether the patron has any blocks on their account.

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

Patron data from patronLogin().

Tags
throws
ILS
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 Details

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

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. Item id is used as the array key in the response.

Parameters
$holdDetails : 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

Data for use in a form field

getCancelRequestDetails()

Get Cancel Request Details

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

General method for getting details for cancel requests

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

An array of item data

Return values
string

Data for use in a form field

getCancelStorageRetrievalRequestDetails()

Get Cancel Storage Retrieval Request (Call Slip) Details

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

This function returns the item id and call slip id as a string separated by a pipe, which is then submitted as form data. This value is then extracted by the CancelStorageRetrievalRequests function. The item id is used as the key in the return value.

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 Holds, StorageRetrievalRequests, and Consortial 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.

getConsortialHoldings()

Get Consortial Holding

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

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

Parameters
$id : string

The record id to retrieve the holdings for

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

Patron data

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

The (consortial) source records for the record id

Tags
throws
DateException
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

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

getCourses()

Get Courses

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

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

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

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

getDefaultPickUpLocation()

Get Default Pick Up Location

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

Returns the default pick up location set in HorizonXMLAPI.ini

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

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
string

A location ID

getDepartments()

Get Departments

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

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

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

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

getFunds()

Get Funds

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

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

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

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

getHolding()

Get Holding

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

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

Parameters
$id : string

The record id to retrieve the holdings for

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

Patron data

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

Extra options (not currently used)

Tags
throws
DateException
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

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

getInstructors()

Get Instructors

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

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

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

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

getLookupAgencyRequest()

Get LookupAgency Request XML message

public getLookupAgencyRequest([string|null $agency = null ]) : string
Parameters
$agency : string|null = null

Agency Id

Return values
string

XML Document

getMyFines()

Get Patron Fines

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

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

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

The patron array from patronLogin

Tags
throws
DateException
throws
ILS
Return values
mixed

Array of the patron's fines on success.

getMyHolds()

Get Patron Holds

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

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

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

The patron array from patronLogin

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

Array of the patron's holds on success.

getMyProfile()

Get Patron Profile

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

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

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

The patron array

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

Array of the patron's profile data on success.

getMyStorageRetrievalRequests()

Get Patron Storage Retrieval Requests

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

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

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

The patron array from patronLogin

Return values
array<string|int, mixed>

Array of the patron's storage retrieval requests.

getMyTransactions()

Get Patron Transactions

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

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

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

The patron array from patronLogin

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

Array of the patron's transactions on success.

getNewItems()

Get New Items

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

Retrieve the IDs of items recently added to the catalog.

Parameters
$page : int

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

$limit : int

The size of each page of results to retrieve

$daysOld : int

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

$fundId : int = null

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

Tags
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

Associative array with 'count' and 'results' keys

getNewOAuth2Token()

Get new authorization token from API using given credentials

public getNewOAuth2Token(string $tokenEndpoint, string $clientId, string $clientSecret[, string $grantType = 'client_credentials' ][, bool $useHttpBasic = false ]) : AuthToken
Parameters
$tokenEndpoint : string

URL of token endpoint

$clientId : string

Client id

$clientSecret : string

Client secret

$grantType : string = 'client_credentials'

Grant type (usually 'client_credentials')

$useHttpBasic : bool = false

Use HTTP Basic authorization for getting token

Tags
throws
AuthToken
Return values
AuthToken

getPickUpLocations()

Get Pick Up Locations

public getPickUpLocations(array<string|int, mixed> $patron[, 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>

Patron information returned by the patronLogin method.

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

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

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array of associative arrays with locationID and locationDisplay keys

getPurchaseHistory()

Get Purchase History

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

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

Parameters
$id : string

The record id to retrieve the info for

Tags
throws
ILS
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

An array with the acquisitions data on success.

getRenewDetails()

Get Renew Details

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

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

getStatus()

Get Status

public getStatus(string $id) : mixed

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

Parameters
$id : string

The record id to retrieve the holdings for

Tags
throws
ILS
Return values
mixed

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

getStatuses()

Get Statuses

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

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

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

The array of record ids to retrieve the status for

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

An array of getStatus() return values on success.

getSuppressedRecords()

Get suppressed records.

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

ID numbers of suppressed records in the system.

getTranslator()

Get translator object.

public getTranslator() : TranslatorInterface
Return values
TranslatorInterface

getTranslatorLocale()

Get the locale from the translator.

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

Default to use if translator absent.

Return values
string

handleCancelRequest()

General cancel request method

public handleCancelRequest(array<string|int, mixed> $cancelDetails[, string $type = 'Hold' ]) : array<string|int, mixed>

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

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

An array of item and patron data

$type : string = 'Hold'

Type of request, could be: 'Hold', 'Stack Retrieval'

Return values
array<string|int, mixed>

An array of data on each request including whether or not it was successful.

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

loadPickUpLocations()

Load pickup locations from file or from NCIP responder - it depends on configuration

public loadPickUpLocations() : void
Tags
throws
ILS
Return values
void

loadPickUpLocationsFromNcip()

Loads pickup location information from LookupAgency NCIP service.

public loadPickUpLocationsFromNcip() : void
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's 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> $details) : mixed

Attempts to place a hold or recall on a particular item and returns an array with result details or throws an exception on failure of support classes

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

An array of item and patron data

Tags
throws
ILS
Return values
mixed

An array of data on the request including whether or not it was successful

placeRequest()

Place a general request

public placeRequest(array<string|int, mixed> $details[, string $type = 'Hold' ]) : mixed

Attempts to place a hold or recall on a particular item and returns an array with result details or throws an exception on failure of support classes

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

An array of item and patron data

$type : string = 'Hold'

Type of request, could be 'Hold' or 'Stack Retrieval'

Tags
throws
ILS
Return values
mixed

An array of data on the request including whether or not it was successful

placeStorageRetrievalRequest()

Place Storage Retrieval Request (Call Slip)

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

Attempts to place a call slip 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.

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

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

translate()

Translate a string (or string-castable object)

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

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

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

Tokens to inject into the translated string

$default : string = null

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

$useIcuFormatter : bool = false

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

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

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

Return values
string

translateWithPrefix()

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

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

Translation key prefix

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

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

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

Tokens to inject into the translated string

$default : string = null

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

$useIcuFormatter : bool = false

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

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

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

Return values
string

checkRequestType()

Is request of desired type?

protected checkRequestType(SimpleXMLElement $request, array<string|int, mixed> $types) : bool
Parameters
$request : SimpleXMLElement

RequestedItem NCIP Element

$types : array<string|int, mixed>

Array of types to check against

Return values
bool

Return true if request is of desired type

checkResponseForError()

Throw an exception if an NCIP error is found

protected checkResponseForError(SimpleXMLElement $response) : void
Parameters
$response : SimpleXMLElement

from NCIP call

Tags
throws
ILS
Return values
void

convertDateOrTime()

Convert datetime to display format

protected convertDateOrTime(string $dateString[, string $dateOrTime = 'date' ]) : string
Parameters
$dateString : string

Datetime string

$dateOrTime : string = 'date'

Desired datetime part, could be 'date' or 'time'

Return values
string

determineToAgencyId()

Determine ToAgencyId

protected determineToAgencyId([array<string|int, mixed>|string|null $agency = null ]) : string|null
Parameters
$agency : array<string|int, mixed>|string|null = null

List of available (configured) agencies or Agency Id

Return values
string|null

First Agency Id found

displayDate()

Convert a date to display format

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

Date and time string

Return values
string

displayTime()

Convert a time to display format

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

Date and time string

Return values
string

element()

Creates simple element as XML string

protected element(string $elementName, string $text[, string $namespacePrefix = 'ns1' ]) : string
Parameters
$elementName : string

Element name

$text : string

Content of element

$namespacePrefix : string = 'ns1'

Namespace

Return values
string

XML string

extractTextDomain()

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

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

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

Return values
array<string|int, mixed>

getAuthenticationInputXml()

Get XML string for AuthenticationInput element

protected getAuthenticationInputXml(string $username, string $password) : string
Parameters
$username : string

User login

$password : string

User password

Return values
string

XML string for AuthenticationInput element

getBibliographicId()

Get BibliographicId element

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

Bibliographic item id

Return values
string

Get BibliographicId XML element string

getBibs()

Get all bibliographic records

protected getBibs(array<string|int, mixed> $idList, array<string|int, mixed> $agencyList) : array<string|int, SimpleXMLElement>
Parameters
$idList : array<string|int, mixed>

List of bibliographic IDs.

$agencyList : array<string|int, mixed>

List of possible toAgency values

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

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

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

getCancelRequest()

Helper function to build the request XML to cancel a request:

protected getCancelRequest(string $username, string $password, string $patronAgency, string $itemAgencyId, string $requestId, string $type, string $itemId[, string $patronId = null ]) : string
Parameters
$username : string

Username for login

$password : string

Password for login

$patronAgency : string

Agency for patron

$itemAgencyId : string

Agency ID for item

$requestId : string

Id of the request to cancel

$type : string

The type of request to cancel (Hold, etc)

$itemId : string

Item identifier

$patronId : string = null

Patron identifier

Return values
string

NCIP request XML

getDebugTranslation()

Build a debug-mode translation

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

Text domain

$str : string

String to translate

$tokens : array<string|int, mixed>

Tokens to inject into the translated string

Return values
string

getHoldingsForChunk()

Given a chunk of the availability response, extract the values needed by VuFind.

protected getHoldingsForChunk(SimpleXMLElement $current[, string $aggregateId = null ][, string $bibId = null ][, array<string|int, mixed> $patron = null ]) : array<string|int, mixed>
Parameters
$current : SimpleXMLElement

Current ItemInformation element

$aggregateId : string = null

(Aggregate) ID of the consortial record

$bibId : string = null

Bib ID of one of the consortial record's source record(s)

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

Patron array from patronLogin

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

getHoldType()

Get Hold Type

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

Status string from CirculationStatus NCIP element

Return values
string

Hold type, could be 'Hold' or 'Recall'

getInitiationHeaderXml()

Get InitiationHeader element XML string

protected getInitiationHeaderXml([string $agency = null ]) : string
Parameters
$agency : string = null

Agency of NCIP responder

Return values
string

getItemIdXml()

Get ItemId element XML

protected getItemIdXml(string $agency, string $itemId[, null|string $idType = null ]) : string
Parameters
$agency : string

Agency id

$itemId : string

Item id

$idType : null|string = null

Item id type

Return values
string

ItemId element XML string

getLookupItemRequest()

Create Lookup Item Request

protected getLookupItemRequest(string $itemId[, string|null $idType = null ][, array<string|int, mixed> $desiredParts = ['Bibliographic Description'] ]) : string
Parameters
$itemId : string

Item identifier

$idType : string|null = null

Item identifier type

$desiredParts : array<string|int, mixed> = ['Bibliographic Description']

Needed data, available options are: 'Bibliographic Description', 'Circulation Status', 'Electronic Resource', 'Hold Queue Length', 'Date Due', 'Item Description', 'Item Use Restriction Type', 'Location', 'Physical Condition', 'Security Marker', 'Sensitization Flag'

Return values
string

XML document

getLookupUserExtras()

Creates array for Lookup user desired information

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

getLookupUserRequest()

Helper function to build the request XML to log in a user and/or retrieve loaned items / request information

protected getLookupUserRequest(string $username, string $password[, string $patronAgencyId = null ][, array<string|int, mixed> $extras = [] ][, string $patronId = null ]) : string
Parameters
$username : string

Username for login

$password : string

Password for login

$patronAgencyId : string = null

Patron agency ID (optional)

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

Extra elements to include in the request

$patronId : string = null

Patron internal identifier

Return values
string

NCIP request XML

getLookupUserResponse()

Get Lookup user response

protected getLookupUserResponse(string $username[, string|null $password = null ]) : SimpleXMLElement
Parameters
$username : string

User name

$password : string|null = null

User password

Tags
throws
ILS
Return values
SimpleXMLElement

getMyRequests()

Get Patron requests by type

protected getMyRequests(array<string|int, mixed> $patron, array<string|int, mixed> $types) : array<string|int, mixed>

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

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

The patron array from patronLogin

$types : array<string|int, mixed>

Request types

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

Array of the patron's holds on success.

getNCIPMessageStart()

Helper method for creating XML header and main element start

protected getNCIPMessageStart() : string
Return values
string

getOAuth2Token()

Get a new or cached OAuth2 token (type + token)

protected getOAuth2Token([bool $renew = false ]) : string
Parameters
$renew : bool = false

Force renewal of token

Return values
string

getPatronBlocks()

Return patron blocks

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

Patron data from patronLogin method

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

getProblemDescription()

Get problem description as one string

protected getProblemDescription(SimpleXMLElement $xml[, array<string|int, mixed>|array<string|int, string> $elements = ['ProblemType', 'ProblemDetail', 'ProblemElement', 'ProblemValue'] ][, bool $withElementNames = true ]) : string
Parameters
$xml : SimpleXMLElement

XML response

$elements : array<string|int, mixed>|array<string|int, string> = ['ProblemType', 'ProblemDetail', 'ProblemElement', 'ProblemValue']

Which of Problem subelements return in description - defaulting to full list: ProblemType, ProblemDetail, ProblemElement and ProblemValue

$withElementNames : bool = true

Whether to add element names as value labels (for example for debug purposes)

Return values
string

getRenewRequest()

Helper function to build the request XML to renew an item:

protected getRenewRequest(string $username, string $password, string $itemId, string $itemAgencyId, string $patronAgencyId[, string $patronId = null ]) : string
Parameters
$username : string

Username for login

$password : string

Password for login

$itemId : string

Id of item to renew

$itemAgencyId : string

Agency of Item Id to renew

$patronAgencyId : string

Agency of patron

$patronId : string = null

Internal patron id

Return values
string

NCIP request XML

getRequest()

Helper function to build the request XML to request an item (Hold, Storage Retrieval, etc)

protected getRequest(string $username, string $password, string $bibId, string $itemId, string $patronAgencyId, string $itemAgencyId, string $requestType, string $requestScope, string $lastInterestDate[, string $pickupLocation = null ][, string $patronId = null ]) : string
Parameters
$username : string

Username for login

$password : string

Password for login

$bibId : string

Bib Id of item to request

$itemId : string

Id of item to request

$patronAgencyId : string

Patron agency ID

$itemAgencyId : string

Item agency ID

$requestType : string

Type of the request (Hold, Callslip, etc)

$requestScope : string

Level of request (title, item, etc)

$lastInterestDate : string

Last date interested in item

$pickupLocation : string = null

Code of location to pickup request

$patronId : string = null

Patron internal identifier

Return values
string

NCIP request XML

getRequestTypeXml()

Get request type elements XML

protected getRequestTypeXml(string $type[, string $scope = 'Bibliographic Item' ]) : string
Parameters
$type : string

Request type

$scope : string = 'Bibliographic Item'

Request type scope (defaults to 'Bibliographic Item')

Return values
string

RequestType and RequestScopeType element XML string

getStatusForChunk()

Given a chunk of the availability response, extract the values needed by VuFind.

protected getStatusForChunk(SimpleXMLElement $current) : array<string|int, mixed>
Parameters
$current : SimpleXMLElement

Current LUIS holding chunk.

Return values
array<string|int, mixed>

of status information for this holding

getStatusRequest()

Build NCIP2 request XML for item status information.

protected getStatusRequest(array<string|int, mixed> $idList[, string $resumption = null ][, string $agency = null ]) : string
Parameters
$idList : array<string|int, mixed>

IDs to look up.

$resumption : string = null

Resumption token (null for first page of set).

$agency : string = null

Agency ID.

Return values
string

XML request

getUserIdXml()

Get UserId element XML

protected getUserIdXml(string $patronAgency[, string $patronId = null ]) : string
Parameters
$patronAgency : string

Patron agency id

$patronId : string = null

Internal patron identifier

Return values
string

Get UserId element XML string

invalidateResponseCache()

Invalidate L1 cache for responses

protected invalidateResponseCache(string $message, string $key) : void
Parameters
$message : string

NCIP message type - currently only 'LookupUser'

$key : string

Cache key (For LookupUser its cat_username)

Return values
void

isAvailable()

Is an item available?

protected isAvailable(string $status) : bool
Parameters
$status : string

Status string from CirculationStatus NCIP element

Return values
bool

Return true if item is available

isItemHoldable()

Check if item is holdable

protected isItemHoldable(SimpleXMLElement $itemInformation) : bool
Parameters
$itemInformation : SimpleXMLElement

Item information element

Return values
bool

isNextItemTokenEmpty()

Check NextItemToken for emptiness

protected isNextItemTokenEmpty(array<string|int, SimpleXMLElement$nextItemToken) : bool
Parameters
$nextItemToken : array<string|int, SimpleXMLElement>

Next item token elements from NCIP Response

Return values
bool

isPatronBlocked()

Helper function to distinguish if blocks are really blocking patron from actions on ILS, or if they are more like notifies

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

Patron from patronLogin

Tags
throws
ILS
Return values
bool

isRequestCancelled()

Is request cancelled?

protected isRequestCancelled(string $status) : bool
Parameters
$status : string

Status string from RequestStatusType NCIP element

Return values
bool

Return true if a request was cancelled

loadPickUpLocationsFromFile()

Loads pickup location information from configuration file.

protected loadPickUpLocationsFromFile(string $filename) : void
Parameters
$filename : string

File to load from

Tags
throws
ILS
Return values
void

parseLocationInstance()

Parse the LocationNameInstanceElement for multi-level locations

protected parseLocationInstance(array<string|int, mixed> $locations) : array<string|int, mixed>
Parameters
$locations : array<string|int, mixed>

Array of \SimpleXMLElement objects for LocationNameInstance element

Return values
array<string|int, mixed>

Two item, 1st and 2nd level from LocationNameInstance

parseProblem()

Parse all reported problem and return its string representation

protected parseProblem(string $xmlString) : string
Parameters
$xmlString : string

XML string

Return values
string

parseXml()

Parse http response into XML object representation

protected parseXml(string $xmlString) : SimpleXMLElement
Parameters
$xmlString : string

XML string

Tags
throws
ILS
Return values
SimpleXMLElement

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

registerNamespaceFor()

Register namespace(s) for an XML element/tree

protected registerNamespaceFor(SimpleXMLElement $element) : void
Parameters
$element : SimpleXMLElement

Element to register namespace for

Return values
void

removeCachedData()

Helper function for removing cached data.

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

Cache entry key

Return values
void

sanitizeTranslationKey()

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

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

Key to sanitize

Return values
string

Sanitized key

schemeAttr()

Creates scheme attribute based on $this->schemes array

protected schemeAttr(string $element[, string $namespacePrefix = 'ns1' ]) : string
Parameters
$element : string

Element name

$namespacePrefix : string = 'ns1'

Namespace identifier

Return values
string

Scheme attribute or empty string

sendRequest()

Send an NCIP request.

protected sendRequest(string $xml) : SimpleXMLElement
Parameters
$xml : string

XML request document

Tags
throws
ILS
Return values
SimpleXMLElement

SimpleXMLElement parsed from response

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

translateMessage()

Translate a message from ILS

protected translateMessage(string $message) : string
Parameters
$message : string

Message to be translated

Return values
string

translateString()

Get translation for a string

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

String to translate

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

Tokens to inject into the translated string

$default : string = null

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

$domain : string = 'default'

Text domain (omit for default)

$useIcuFormatter : bool = false

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

Return values
string

Search results