Horizon
extends AbstractBase
in package
implements
LoggerAwareInterface
Uses
LoggerAwareTrait
Horizon ILS Driver
Tags
Interfaces, Classes, Traits and Enums
- LoggerAwareInterface
Table of Contents
- $config : array<string|int, mixed>
- Driver configuration
- $dateFormat : Converter
- Date converter object
- $db : PDO
- Database connection
- __construct() : mixed
- Constructor
- getFunds() : array<string|int, mixed>
- Get Funds
- getHolding() : array<string|int, mixed>
- Get Holding
- getMyFines() : mixed
- Get Patron Fines
- getMyHolds() : array<string|int, mixed>
- Get Patron Holds
- getMyProfile() : array<string|int, mixed>
- Get Patron Profile
- getMyTransactions() : array<string|int, mixed>
- Get Patron Transactions
- getNewItems() : array<string|int, mixed>
- Get New Items
- getPurchaseHistory() : array<string|int, mixed>
- Get Purchase History
- getStatus() : mixed
- Get Status
- getStatuses() : array<string|int, mixed>
- Get Statuses
- getSuppressedRecords() : array<string|int, mixed>
- Get suppressed records.
- init() : void
- Initialize the driver.
- patronLogin() : mixed
- Patron Login
- setConfig() : void
- Set configuration.
- buildSqlFromArray() : array<string|int, mixed>
- Protected support method for building sql strings.
- checkHzVersion() : bool
- Check Horizon Version
- debug() : void
- Log a debug message.
- getHoldingSQL() : array<string|int, mixed>
- Protected support method for getHolding.
- getHoldsSQL() : array<string|int, mixed>
- Protected support method for getMyHolds.
- getStatusesSQL() : array<string|int, mixed>
- Protected support method for getStatus.
- getTransactionSQL() : array<string|int, mixed>
- Protected support method for getMyTransactions.
- log() : void
- Send a message to the logger.
- logError() : void
- Log an error message.
- logWarning() : void
- Log a warning message.
- parseStatus() : array<string|int, mixed>
- Protected support method determine availability, reserve and duedate values based on item status. Used by getHolding, getStatus and getStatuses.
- processHoldingRow() : array<string|int, mixed>
- Protected support method for getHolding.
- processHoldsRow() : array<string|int, mixed>
- Protected support method for getMyHolds.
- processStatusRow() : array<string|int, mixed>
- Protected support method for getStatuses.
- processTransactionsRow() : array<string|int, mixed>
- Protected support method for getMyTransactions.
- throwAsIlsException() : never
- Rethrow the provided exception as an ILS exception.
Properties
$config
Driver configuration
protected
array<string|int, mixed>
$config
= []
$dateFormat
Date converter object
protected
Converter
$dateFormat
$db
Database connection
protected
PDO
$db
Methods
__construct()
Constructor
public
__construct(Converter $dateConverter) : mixed
Parameters
- $dateConverter : Converter
-
Date converter object
Return values
mixed —getFunds()
Get Funds
public
getFunds() : array<string|int, mixed>
Return a list of funds which may be used to limit the getNewItems list.
Tags
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
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.
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
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
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
Return values
array<string|int, mixed> —Array of the patron's profile data on success, throw ILSException if none found
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
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.
The logic in this function follows the pattern used for the "New Additions" functionality of the Horizon staff client. New Additions was delivered with Horizon 7.4 and requires setup. Follow instructions in the "Circulation Setup Guide". The minimum setup is to set the "Track First Availability" flag for each appropriate item status.
Parameters
- $page : int
-
Not implemented in this driver - Sybase does not have SQL query paging functionality.
- $limit : int
-
The maximum number of results to retrieve
- $daysOld : int
-
The maximum age of records to retrieve in days (max. 30)
- $fundId : int = null
-
Not implemented in this driver - The contributing library does not use acquisitions.
Tags
Return values
array<string|int, mixed> —Associative array with 'count' and 'results' 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
Return values
array<string|int, mixed> —An array with the acquisitions data on success.
getStatus()
Get Status
public
getStatus(string $id) : mixed
This is responsible for retrieving the status information of a specific record. It is a proxy to getStatuses.
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, and 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
Return values
array<string|int, mixed> —An array of getStatus() return values on success.
getSuppressedRecords()
Get suppressed records.
public
getSuppressedRecords() : array<string|int, mixed>
Get a list of Horizon bib numbers that have the staff-only flag set.
Return values
array<string|int, mixed> —ID numbers of suppressed records in the system.
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's password
Tags
Return values
mixed —Associative array of patron info on successful login, ILSException on unsuccessful login.
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 —buildSqlFromArray()
Protected support method for building sql strings.
protected
buildSqlFromArray(array<string|int, mixed> $sql) : array<string|int, mixed>
Parameters
- $sql : array<string|int, mixed>
-
An array of keyed sql data
Return values
array<string|int, mixed> —An string query string
checkHzVersion()
Check Horizon Version
protected
checkHzVersion(string $hzVersionRequired) : bool
Check the Horizon version found in the matham table to make sure it is at least the required version.
Parameters
- $hzVersionRequired : string
-
Minimum version required
Return values
bool —True or False the required version is the same or higher.
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 —getHoldingSQL()
Protected support method for getHolding.
protected
getHoldingSQL(array<string|int, mixed> $id) : array<string|int, mixed>
Parameters
- $id : array<string|int, mixed>
-
A Bibliographic id
Return values
array<string|int, mixed> —Keyed data for use in an sql query
getHoldsSQL()
Protected support method for getMyHolds.
protected
getHoldsSQL(array<string|int, mixed> $patron) : array<string|int, mixed>
Parameters
- $patron : array<string|int, mixed>
-
Patron data for use in an sql query
Return values
array<string|int, mixed> —Keyed data for use in an sql query
getStatusesSQL()
Protected support method for getStatus.
protected
getStatusesSQL(array<string|int, mixed> $idList) : array<string|int, mixed>
Parameters
- $idList : array<string|int, mixed>
-
A list of Bibliographic id
Return values
array<string|int, mixed> —Keyed data for use in an sql query
getTransactionSQL()
Protected support method for getMyTransactions.
protected
getTransactionSQL(array<string|int, mixed> $patron) : array<string|int, mixed>
Parameters
- $patron : array<string|int, mixed>
-
Patron data for use in an sql query
Return values
array<string|int, mixed> —Keyed data for use in an sql query
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 —parseStatus()
Protected support method determine availability, reserve and duedate values based on item status. Used by getHolding, getStatus and getStatuses.
protected
parseStatus(string $status) : array<string|int, mixed>
Parameters
- $status : string
-
Item status code
Return values
array<string|int, mixed> —processHoldingRow()
Protected support method for getHolding.
protected
processHoldingRow(string $id, array<string|int, mixed> $row, array<string|int, mixed> $patron) : array<string|int, mixed>
Parameters
- $id : string
-
Bib Id
- $row : array<string|int, mixed>
-
SQL Row Data
- $patron : array<string|int, mixed>
-
Patron Array
Tags
Return values
array<string|int, mixed> —Keyed data
processHoldsRow()
Protected support method for getMyHolds.
protected
processHoldsRow(array<string|int, mixed> $row) : array<string|int, mixed>
Parameters
- $row : array<string|int, mixed>
-
An sql row
Tags
Return values
array<string|int, mixed> —Keyed data
processStatusRow()
Protected support method for getStatuses.
protected
processStatusRow(string $id, array<string|int, mixed> $row) : array<string|int, mixed>
Parameters
- $id : string
-
Bib Id
- $row : array<string|int, mixed>
-
SQL Row Data
Return values
array<string|int, mixed> —Keyed data
processTransactionsRow()
Protected support method for getMyTransactions.
protected
processTransactionsRow(array<string|int, mixed> $row) : array<string|int, mixed>
Parameters
- $row : array<string|int, mixed>
-
An array of keyed data
Tags
Return values
array<string|int, mixed> —Keyed data for display by template files
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)