Polaris
extends AbstractBase
in package
implements
HttpServiceAwareInterface
Uses
HttpServiceAwareTrait
VuFind Connector for Polaris
Based on Polaris 1.4 API
Tags
Interfaces, Classes, Traits and Enums
- HttpServiceAwareInterface
Table of Contents
- $config : array<string|int, mixed>
- Driver configuration
- $defaultPickUpLocation : string
- Default pick up location
- $ws_api_id : string
- Web services ID
- $ws_api_key : string
- Web services key
- $ws_app : string
- Web services application path
- $ws_host : string
- Web services host
- $ws_requestingorgid : string
- Web services requesting organization ID
- cancelHolds() : array<string|int, mixed>
- Cancel Holds
- encodeJSONTime() : string
- Encode from human-readable date to text like Date(1360051200000-0800)
- findReserves() : mixed
- Find Reserves
- formatJSONTime() : string
- Return human-readable date from text like Date(1360051200000-0800)
- getCancelHoldDetails() : string
- Get Cancel Hold Details
- getCheckoutHistory() : mixed
- Get Checkout History
- 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
- getHoldCount() : string
- Get Hold Count
- getHolding() : mixed
- Get Holding
- getMyFines() : mixed
- Get Patron Fines
- getMyHolds() : mixed
- Get Patron Holds
- getMyProfile() : array<string|int, mixed>
- Get Patron Profile
- getMyTransactions() : mixed
- Get Patron Transactions
- getNewItems() : array<string|int, mixed>
- Get New Items
- getPickUpLocations() : array<string|int, mixed>
- Get Pick Up Locations
- getPurchaseHistory() : mixed
- Get Purchase History
- getRenewDetails() : string
- Get Renew Details
- getStatus() : mixed
- Get Status
- getStatuses() : mixed
- Get Statuses
- getSuspendHoldDetails() : string
- Get Suspend Hold Details
- init() : void
- Initialize the driver.
- patronLogin() : mixed
- Patron Login
- placeHold() : mixed
- Place Hold
- reactivateHolds() : array<string|int, mixed>
- Reactivate Holds
- renewMyItems() : array<string|int, mixed>
- Renew My Items
- setConfig() : void
- Set configuration.
- suspendHolds() : array<string|int, mixed>
- Suspend Holds
- makeRequest() : obj
- Make Request
- throwAsIlsException() : never
- Rethrow the provided exception as an ILS exception.
Properties
$config
Driver configuration
protected
array<string|int, mixed>
$config
= []
$defaultPickUpLocation
Default pick up location
protected
string
$defaultPickUpLocation
$ws_api_id
Web services ID
protected
string
$ws_api_id
$ws_api_key
Web services key
protected
string
$ws_api_key
$ws_app
Web services application path
protected
string
$ws_app
$ws_host
Web services host
protected
string
$ws_host
$ws_requestingorgid
Web services requesting organization ID
protected
string
$ws_requestingorgid
Methods
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 and a system message (if available)
encodeJSONTime()
Encode from human-readable date to text like Date(1360051200000-0800)
public
encodeJSONTime(string $date) : string
Parameters
- $date : string
-
Input
Return values
string —findReserves()
Find Reserves
public
findReserves(string $course, string $inst, string $dept) : mixed
Obtain information on course reserves.
Parameters
- $course : string
-
ID from getCourses (empty string to match all)
- $inst : string
-
ID from getInstructors (empty string to match all)
- $dept : string
-
ID from getDepartments (empty string to match all)
Tags
Return values
mixed —An array of associative arrays representing reserve items.
formatJSONTime()
Return human-readable date from text like Date(1360051200000-0800)
public
formatJSONTime(string $jsontime) : string
Parameters
- $jsontime : string
-
Input
Return values
string —getCancelHoldDetails()
Get Cancel Hold Details
public
getCancelHoldDetails(array<string|int, mixed> $holdDetails[, array<string|int, mixed> $patron = [] ]) : string
Parameters
- $holdDetails : array<string|int, mixed>
-
A single hold array from getMyHolds
- $patron : array<string|int, mixed> = []
-
Patron information from patronLogin
Tags
Return values
string —Data for use in a form field (just request id is all Polaris needs)
getCheckoutHistory()
Get Checkout History
public
getCheckoutHistory(array<string|int, mixed> $patron) : mixed
Returns the patrons checkout / reading history
Parameters
- $patron : array<string|int, mixed>
-
The patron array from patronLogin
Return values
mixed —Array of the patron's checkouts on success.
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
Return values
array<string|int, mixed> —An array with key-value pairs.
getDefaultPickUpLocation()
Get Default Pick Up Location
public
getDefaultPickUpLocation([array<string|int, mixed> $patron = false ][, array<string|int, mixed> $holdDetails = null ]) : string
Returns the default pick up location set in VoyagerRestful.ini
Parameters
- $patron : array<string|int, mixed> = false
-
Patron information returned by the patronLogin method.
- $holdDetails : array<string|int, mixed> = null
-
Optional array, only passed in when getting a list in the context of placing a hold; contains most of the same values passed to placeHold, minus the patron data. May be used to limit the pickup options or may be ignored.
Tags
Return values
string —The default pickup location for the patron.
getHoldCount()
Get Hold Count
public
getHoldCount(array<string|int, mixed> $id) : string
Returns the count of a hold based on API call to bibid
Parameters
- $id : array<string|int, mixed>
-
bib id
Return values
string —count of holds
getHolding()
Get Holding
public
getHolding(string $id[, array<string|int, mixed> $patron = null ][, array<string|int, mixed> $options = [] ]) : 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
Return values
mixed —On success, an associative array with the following keys: id, availability (boolean), status, location, reserve, callnumber, duedate, number, barcode.
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.
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
Return values
array<string|int, mixed> —Array of the patron's profile data on success.
getMyTransactions()
Get Patron Transactions
public
getMyTransactions(array<string|int, mixed> $patron) : 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
mixed —Array of associative arrays 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
Return values
array<string|int, mixed> —Associative array with 'count' and 'results' keys
getPickUpLocations()
Get Pick Up Locations
public
getPickUpLocations([array<string|int, mixed> $patron = false ][, array<string|int, mixed> $holdDetails = null ]) : array<string|int, mixed>
This is responsible for getting a list of valid library locations for holds / recall retrieval
Parameters
- $patron : array<string|int, mixed> = false
-
Patron information returned by the patronLogin method.
- $holdDetails : array<string|int, mixed> = null
-
Optional array, only passed in when getting a list in the context of placing or editing a hold. When placing a hold, it contains most of the same values passed to placeHold, minus the patron data. When editing a hold it contains all the hold information returned by getMyHolds. May be used to limit the pickup options or may be ignored. The driver must not add new options to the return array based on this data or other areas of VuFind may behave incorrectly.
Tags
Return values
array<string|int, mixed> —An array of associative arrays with locationID and locationDisplay keys
getPurchaseHistory()
Get Purchase History
public
getPurchaseHistory(string $id) : 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
mixed —An array with the acquisitions data on success.
getRenewDetails()
Get Renew Details
public
getRenewDetails(array<string|int, mixed> $checkOutDetails) : string
In order to renew an item, Voyager requires the patron details and an item id. This function returns the item id as a string which is then used as submitted form data in checkedOut.php. This value is then extracted by the RenewMyItems function.
Parameters
- $checkOutDetails : array<string|int, mixed>
-
An array of item data
Return values
string —Data for use in a form field
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) : 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
mixed —An array of getStatus() return values on success.
getSuspendHoldDetails()
Get Suspend Hold Details
public
getSuspendHoldDetails(array<string|int, mixed> $holdDetails) : string
Parameters
- $holdDetails : array<string|int, mixed>
-
An array of item data
Return values
string —Data for use in a form field (just request id is all Polaris needs)
init()
Initialize the driver.
public
init() : void
Validate configuration and perform all resource-intensive tasks needed to make the driver active.
Tags
Return values
void —patronLogin()
Patron Login
public
patronLogin(string $username, string $password) : mixed
This is responsible for authenticating a patron against the catalog.
Parameters
- $username : string
-
The patron username
- $password : string
-
The patron password
Return values
mixed —Associative array of patron info on successful login, null on unsuccessful login.
placeHold()
Place Hold
public
placeHold(array<string|int, mixed> $holdDetails) : mixed
Attempts to place a hold or recall on a particular item and returns an array with result details.
Parameters
- $holdDetails : array<string|int, mixed>
-
An array of item and patron data
Return values
mixed —An array of data on the request including whether or not it was successful and a system message (if available)
reactivateHolds()
Reactivate Holds
public
reactivateHolds(array<string|int, mixed> $reactivateDetails) : array<string|int, mixed>
Attempts to Reactivate a hold or recall on a particular item. The data in $reactivateDetails['details'] is determined by getReactivateHoldDetails().
Parameters
- $reactivateDetails : 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)
renewMyItems()
Renew My Items
public
renewMyItems(array<string|int, mixed> $renewDetails) : array<string|int, mixed>
Function for attempting to renew a patron's items. The data in $renewDetails['details'] is determined by getRenewDetails().
Parameters
- $renewDetails : array<string|int, mixed>
-
An array of data required for renewing items including the Patron ID and an array of renewal IDS
Return values
array<string|int, mixed> —An array of renewal information keyed by item ID
setConfig()
Set configuration.
public
setConfig(array<string|int, mixed> $config) : void
Set the configuration for the driver.
Parameters
- $config : array<string|int, mixed>
-
Configuration array (usually loaded from a VuFind .ini file whose name corresponds with the driver class name).
Return values
void —suspendHolds()
Suspend Holds
public
suspendHolds(array<string|int, mixed> $suspendDetails) : array<string|int, mixed>
Attempts to Suspend a hold or recall on a particular item. The data in $suspendDetails['details'] is determined by getSuspendHoldDetails().
Parameters
- $suspendDetails : 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)
makeRequest()
Make Request
protected
makeRequest(string $api_query[, string $http_method = 'GET' ][, string $patronpassword = '' ][, bool $json = false ]) : obj
Makes a request to the Polaris Restful API
Parameters
- $api_query : string
-
Query string for request
- $http_method : string = 'GET'
-
HTTP method (default = GET)
- $patronpassword : string = ''
-
Patron password (optional)
- $json : bool = false
-
Optional JSON attachment
Tags
Return values
obj —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)