VuFind API Documentation

Alma extends AbstractBase
in package
implements HttpServiceAwareInterface, LoggerAwareInterface, TranslatorAwareInterface Uses HttpServiceAwareTrait, LoggerAwareTrait, CacheTrait, TranslatorAwareTrait

Alma 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

$apiKey  : string
Alma API key.
$baseUrl  : string
Alma API base URL.
$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
$dateConverter  : Converter
Date converter
$locationTypeToItemStatus  : array<string|int, mixed>
Mappings from location type to item status. Overrides any other item status.
$translator  : TranslatorInterface
Translator
__construct()  : mixed
Constructor
cancelHolds()  : array<string|int, mixed>
Cancel hold requests.
checkRequestIsValid()  : bool
Check if request is valid
createAlmaUser()  : null|SimpleXMLElement
Create a user in Alma via API call
findReserves()  : array<string|int, mixed>
Get reserves by course
getAccountBlocks()  : array<string|int, mixed>|bool
Check for account blocks in Alma and cache them.
getConfig()  : array<string|int, mixed>
Public Function which retrieves renew, hold and cancel settings from the driver ini file.
getCourses()  : array<string|int, mixed>
Request from /courses.
getFunds()  : array<string|int, mixed>
Get list of funds
getHolding()  : array<string|int, mixed>
Get Holding
getMyFines()  : mixed
Get Patron Fines
getMyHolds()  : mixed
Get Patron Holds
getMyILLRequests()  : mixed
Get Patron ILL Requests
getMyProfile()  : array<string|int, mixed>
Get Patron Profile
getMyStorageRetrievalRequests()  : mixed
Get Patron Storage Retrieval Requests
getMyTransactions()  : array<string|int, mixed>
Get transactions of the current patron.
getPickupLocations()  : array<string|int, mixed>
Get Pick Up Locations
getPurchaseHistory()  : array<string|int, mixed>
Get Purchase History
getRenewDetails()  : string
Get Alma loan IDs for use in renewMyItems.
getRequestBlocks()  : array<string|int, mixed>|bool
Check for request blocks.
getStatus()  : mixed
Get Status
getStatuses()  : array<string|int, mixed>
Get Statuses
getTranslator()  : TranslatorInterface
Get translator object.
getTranslatorLocale()  : string
Get the locale from the translator.
init()  : void
Initialize the driver.
parseDate()  : string
Parse a date.
patronLogin()  : array<string|int, string>|null
Patron Login
placeHold()  : array<string|int, mixed>
Place a hold request via Alma API. This could be a title level request or an item level request.
renewMyItems()  : array<string|int, array<string|int, mixed>>
Renew loans via Alma API.
setCacheStorage()  : void
Set a cache storage object.
setConfig()  : void
Set configuration.
setTranslator()  : TranslatorAwareInterface
Set a translator
supportsMethod()  : bool
Helper method to determine whether or not a certain method can be called on this driver. Required method for any smart drivers.
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.
updateHolds()  : array<string|int, mixed>
Update holds
debug()  : void
Log a debug message.
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.
getCachedData()  : mixed|null
Helper function for fetching cached data.
getDebugTranslation()  : string
Build a debug-mode translation
getFulfillmentUnitByLocation()  : string|null
Get an Alma fulfillment unit by an Alma location.
getInventoryTypes()  : array<string|int, mixed>
Get the inventory types to be displayed. Possible values are: p_avail,e_avail,d_avail
getItemAvailabilityAndStatus()  : array<string|int, mixed>
Given an item, return its availability and status.
getItemLocation()  : TranslatableString|string
Get location for an item
getItemLocationType()  : string
Get location type for an item
getItemStatusFromLocationTypeMap()  : array<string|int, mixed>
Given an item, return its availability and status based on location type mappings.
getLocations()  : array<string|int, mixed>
Get the locations for a library
getLocationType()  : string
Get type of a location
getPreferredEmail()  : string|null
Get the preferred email address for the user (or first one if no preferred one is found)
getStatusesForInventoryTypes()  : array<string|int, mixed>
Get Statuses for inventory types
getTranslatableStatusString()  : TranslatableString
Gets a translatable string from an element with content and a desc attribute.
getTranslatableString()  : TranslatableString
Gets a translatable string from an element with content and a desc attribute.
log()  : void
Send a message to the logger.
logError()  : void
Log an error message.
logWarning()  : void
Log a warning message.
makeRequest()  : null|SimpleXMLElement|array<string|int, mixed>
Make an HTTP request against Alma
putCachedData()  : void
Helper function for storing cached data.
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.
throwAsIlsException()  : never
Rethrow the provided exception as an ILS exception.
translateString()  : string
Get translation for a string

Properties

$apiKey

Alma API key.

protected string $apiKey

$baseUrl

Alma API base URL.

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

$dateConverter

Date converter

protected Converter $dateConverter

$locationTypeToItemStatus

Mappings from location type to item status. Overrides any other item status.

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

Methods

__construct()

Constructor

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

Date converter object

Return values
mixed

cancelHolds()

Cancel hold requests.

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

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

Return values
array<string|int, mixed>

Associative array containing with keys 'count' (number of items successfully cancelled) and 'items' (array of successful cancellations).

checkRequestIsValid()

Check if request is valid

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 record id

$data : array<string|int, mixed>

An array of item data

$patron : array<string|int, mixed>

An array of patron data

Return values
bool

True if request is valid, false if not

createAlmaUser()

Create a user in Alma via API call

public createAlmaUser(array<string|int, mixed> $formParams) : null|SimpleXMLElement
Parameters
$formParams : array<string|int, mixed>

The data from the "create new account" form

Tags
throws
Auth
author

Michael Birkner

Return values
null|SimpleXMLElement

findReserves()

Get reserves by course

public findReserves(string $courseID, string $instructorID, string $departmentID) : array<string|int, mixed>
Parameters
$courseID : string

Value from getCourses

$instructorID : string

Value from getInstructors (not used yet)

$departmentID : string

Value from getDepartments (not used yet)

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
array<string|int, mixed>

With key BIB_ID - The record ID of the current reserve item. Not currently used: DISPLAY_CALL_NO, AUTHOR, TITLE, PUBLISHER, PUBLISHER_DATE

getAccountBlocks()

Check for account blocks in Alma and cache them.

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

The patron array with username and password

Tags
author

Michael Birkner

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

An array of block messages or false if there are no blocks

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.

getCourses()

Request from /courses.

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

with key = course ID, value = course name

getFunds()

Get list of funds

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

with key = course ID, value = course 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> = []

Additional options

Return values
array<string|int, mixed>

On success an array with the key "total" containing the total number of items for the given bib id, and the key "holdings" containing an array of holding information each one with these keys: id, source, availability, status, location, reserve, callnumber, duedate, returnDate, number, barcode, item_notes, item_id, holdings_id, addLink, description

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

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

Array of the patron's holds on success.

getMyILLRequests()

Get Patron ILL Requests

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

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

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

The patron array from patronLogin

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

Array of the patron's ILL requests

getMyProfile()

Get Patron Profile

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

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

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

The patron array

Return values
array<string|int, mixed>

Array of the patron's profile data on success.

getMyStorageRetrievalRequests()

Get Patron Storage Retrieval Requests

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

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

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

The patron array from patronLogin

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
mixed

Array of the patron's holds

getMyTransactions()

Get transactions of the current patron.

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

The patron array from patronLogin

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

Parameters

Tags
author

Michael Birkner

Return values
array<string|int, mixed>

Transaction information as array.

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

Return values
array<string|int, mixed>

An array with the acquisitions data on success.

getRenewDetails()

Get Alma loan IDs for use in renewMyItems.

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

An array from getMyTransactions

Tags
author

Michael Birkner

Return values
string

The Alma loan ID for this loan

getRequestBlocks()

Check for request blocks.

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

The patron array with username and password

Tags
author

Michael Birkner

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

An array of block messages or false if there are no blocks

getStatus()

Get Status

public getStatus(string $id) : mixed

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

Parameters
$id : string

The record id to retrieve the holdings for

Return values
mixed

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

getStatuses()

Get Statuses

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

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

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

The array of record ids to retrieve the status for

Return values
array<string|int, mixed>

An array of getStatus() return values on success.

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

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

parseDate()

Parse a date.

public parseDate(string $date[, bool $withTime = false ]) : string
Parameters
$date : string

Date to parse

$withTime : bool = false

Add time to return if available?

Return values
string

patronLogin()

Patron Login

public patronLogin(string $username, string $password) : array<string|int, string>|null

This is responsible for authenticating a patron against the catalog.

Parameters
$username : string

The patrons barcode or other username.

$password : string

The patrons password.

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

placeHold()

Place a hold request via Alma API. This could be a title level request or an item level request.

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

An associative array w/ atleast patron and item_id

Tags
link
https://developers.exlibrisgroup.com/alma/apis/bibs
Return values
array<string|int, mixed>

success: bool, sysMessage: string

renewMyItems()

Renew loans via Alma API.

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

An array with the IDs of the loans returned by getRenewDetails and the patron information returned by patronLogin.

Tags
author

Michael Birkner

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

An array with the renewal details and a success or error message.

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

supportsMethod()

Helper method to determine whether or not a certain method can be called on this driver. Required method for any smart drivers.

public supportsMethod(string $method, array<string|int, mixed> $params) : bool
Parameters
$method : string

The name of the called method.

$params : array<string|int, mixed>

Array of passed parameters

Tags
SuppressWarnings

(PHPMD.UnusedFormalParameter)

Return values
bool

True if the method can be called with the given parameters, false otherwise.

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

updateHolds()

Update holds

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

This is responsible for changing the status of hold requests

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

The details identifying the holds

$fields : array<string|int, mixed>

An associative array of fields to be updated

$patron : array<string|int, mixed>

Patron array

Return values
array<string|int, mixed>

Associative array of the results

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

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>

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

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

getFulfillmentUnitByLocation()

Get an Alma fulfillment unit by an Alma location.

protected getFulfillmentUnitByLocation(string $locationCode, array<string|int, mixed> $fulfillmentUnits) : string|null
Parameters
$locationCode : string

A location code, e. g. "SCI"

$fulfillmentUnits : array<string|int, mixed>

An array of fulfillment units with all its locations.

Tags
author

Michael Birkner

Return values
string|null

Null if the location was not found or a string specifying the fulfillment unit of the location that was found.

getInventoryTypes()

Get the inventory types to be displayed. Possible values are: p_avail,e_avail,d_avail

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

getItemAvailabilityAndStatus()

Given an item, return its availability and status.

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

Item data

Return values
array<string|int, mixed>

Availability and status

getItemLocation()

Get location for an item

protected getItemLocation(SimpleXMLElement $item) : TranslatableString|string
Parameters
$item : SimpleXMLElement

Item

Return values
TranslatableString|string

getItemLocationType()

Get location type for an item

protected getItemLocationType(SimpleXMLElement $item) : string
Parameters
$item : SimpleXMLElement

Item

Return values
string

getItemStatusFromLocationTypeMap()

Given an item, return its availability and status based on location type mappings.

protected getItemStatusFromLocationTypeMap(string $locationType) : array<string|int, mixed>
Parameters
$locationType : string

Location type

Return values
array<string|int, mixed>

Availability and status

getLocations()

Get the locations for a library

protected getLocations(string $library) : array<string|int, mixed>
Parameters
$library : string

Library

Return values
array<string|int, mixed>

getLocationType()

Get type of a location

protected getLocationType(string $library, string $location) : string
Parameters
$library : string

Library

$location : string

Location

Return values
string

getPreferredEmail()

Get the preferred email address for the user (or first one if no preferred one is found)

protected getPreferredEmail(SimpleXMLElement $user) : string|null
Parameters
$user : SimpleXMLElement

User data

Return values
string|null

getStatusesForInventoryTypes()

Get Statuses for inventory types

protected getStatusesForInventoryTypes(array<string|int, mixed> $ids, array<string|int, mixed> $types) : array<string|int, mixed>

This is responsible for retrieving the status information for a collection of records with specified inventory types.

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

The array of record ids to retrieve the status for

$types : array<string|int, mixed>

Inventory types

Return values
array<string|int, mixed>

An array of getStatus() return values on success.

getTranslatableStatusString()

Gets a translatable string from an element with content and a desc attribute.

protected getTranslatableStatusString(SimpleXMLElement $element) : TranslatableString
Parameters
$element : SimpleXMLElement

XML element

Return values
TranslatableString

getTranslatableString()

Gets a translatable string from an element with content and a desc attribute.

protected getTranslatableString(SimpleXMLElement $element) : TranslatableString
Parameters
$element : SimpleXMLElement

XML element

Return values
TranslatableString

log()

Send a message to the logger.

protected log(string $level, string $message[, array<string|int, mixed> $context = [] ][, bool $prependClass = false ]) : void
Parameters
$level : string

Log level

$message : string

Log message

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

Log context

$prependClass : bool = false

Prepend class name to message?

Return values
void

logError()

Log an error message.

protected logError(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

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

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

logWarning()

Log a warning message.

protected logWarning(string $msg[, array<string|int, mixed> $context = [] ][, bool $prependClass = true ]) : void
Parameters
$msg : string

Log message

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

Log context

$prependClass : bool = true

Prepend class name to message?

Return values
void

makeRequest()

Make an HTTP request against Alma

protected makeRequest(string $path[, array<string|int, mixed> $paramsGet = [] ][, array<string|int, mixed> $paramsPost = [] ][, string $method = 'GET' ][, string $rawBody = null ][, Headers|array<string|int, mixed> $headers = null ][, array<string|int, mixed> $allowedErrors = [] ][, bool $returnStatus = false ]) : null|SimpleXMLElement|array<string|int, mixed>
Parameters
$path : string

Path to retrieve from API (excluding base URL/API key)

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

Additional GET params

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

Additional POST params

$method : string = 'GET'

GET or POST. Default is GET.

$rawBody : string = null

Request body.

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

Add headers to the call.

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

HTTP status codes that are not treated as API errors.

$returnStatus : bool = false

Whether to return HTTP status in addition to the response.

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

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

sanitizeTranslationKey()

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

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

Key to sanitize

Return values
string

Sanitized key

throwAsIlsException()

Rethrow the provided exception as an ILS exception.

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

Exception to rethrow

$msg : string = null

Override exception message (optional)

Tags
throws
ILS
Return values
never

translateString()

Get translation for a string

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

String to translate

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

Tokens to inject into the translated string

$default : string = null

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

$domain : string = 'default'

Text domain (omit for default)

$useIcuFormatter : bool = false

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

Return values
string

Search results