Koha
extends AbstractBase
in package
VuFind Driver for Koha (version: 3.02)
Tags
Table of Contents
- $blockTerms : array<string|int, mixed>
- Default terms for block types, can be overridden by configuration
- $config : array<string|int, mixed>
- Driver configuration
- $dateConverter : Converter
- Date converter object
- $db : PDO
- Database connection
- $ilsBaseUrl : string
- ILS base URL
- $locCodes : array<string|int, mixed>
- Location codes
- $showBlockComments : array<string|int, mixed>
- Display comments for patron debarments, see Koha.ini
- $validatePasswords : bool
- Should we validate passwords against Koha system?
- __construct() : mixed
- Constructor
- displayDate() : string
- Convert a database date to a displayable date.
- displayDateTime() : string
- Convert a database datetime to a displayable date and time.
- getAccountBlocks() : mixed
- Check whether the patron has any blocks on their account.
- getConfig() : array<string|int, mixed>
- Public Function which retrieves renew, hold and cancel settings from the driver ini file.
- getHolding() : array<string|int, mixed>
- Get Holding
- getHoldLink() : string
- Get Hold Link
- getMyFines() : mixed
- Get Patron Fines
- getMyHolds() : array<string|int, mixed>
- Get Patron Holds
- getMyProfile() : array<string|int, mixed>
- Get Patron Profile
- getMyTransactionHistory() : array<string|int, mixed>
- Get Patron Loan History
- getMyTransactions() : array<string|int, mixed>
- Get Patron Transactions
- 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.
- throwAsIlsException() : never
- Rethrow the provided exception as an ILS exception.
Properties
$blockTerms
Default terms for block types, can be overridden by configuration
protected
array<string|int, mixed>
$blockTerms
= ['SUSPENSION' => 'Account Suspended', 'OVERDUES' => 'Account Blocked (Overdue Items)', 'MANUAL' => 'Account Blocked', 'DISCHARGE' => 'Account Blocked for Discharge']
$config
Driver configuration
protected
array<string|int, mixed>
$config
= []
$dateConverter
Date converter object
protected
Converter
$dateConverter
= null
$db
Database connection
protected
PDO
$db
$ilsBaseUrl
ILS base URL
protected
string
$ilsBaseUrl
$locCodes
Location codes
protected
array<string|int, mixed>
$locCodes
$showBlockComments
Display comments for patron debarments, see Koha.ini
protected
array<string|int, mixed>
$showBlockComments
$validatePasswords
Should we validate passwords against Koha system?
protected
bool
$validatePasswords
Methods
__construct()
Constructor
public
__construct(Converter $dateConverter) : mixed
Parameters
- $dateConverter : Converter
-
Date converter
Return values
mixed —displayDate()
Convert a database date to a displayable date.
public
displayDate(string $date) : string
Parameters
- $date : string
-
Date to convert
Return values
string —displayDateTime()
Convert a database datetime to a displayable date and time.
public
displayDateTime(string $date) : string
Parameters
- $date : string
-
Datetime to convert
Return values
string —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
Return values
mixed —A boolean false if no blocks are in place and an array of block reasons if blocks are in place
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.
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.
getHoldLink()
Get Hold Link
public
getHoldLink(string $id, array<string|int, mixed> $details) : string
The goal for this method is to return a URL to a "place hold" web page on the ILS OPAC. This is used for ILSs that do not support an API or method to place Holds.
Parameters
- $id : string
-
The id of the bib record
- $details : array<string|int, mixed>
-
Item details from getHoldings return array
Tags
Return values
string —URL to ILS's OPAC's place hold screen.
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.
getMyTransactionHistory()
Get Patron Loan History
public
getMyTransactionHistory(array<string|int, mixed> $patron, array<string|int, mixed> $params) : array<string|int, mixed>
This is responsible for retrieving all historic loans (i.e. items previously checked out and then returned), for a specific patron.
Parameters
- $patron : array<string|int, mixed>
-
The patron array from patronLogin
- $params : array<string|int, mixed>
-
Parameters
Tags
Return values
array<string|int, mixed> —Array of the patron's transactions on success.
getMyTransactions()
Get Patron Transactions
public
getMyTransactions(array<string|int, mixed> $patron) : array<string|int, mixed>
This is responsible for retrieving all transactions (i.e. checked out items) by a specific patron.
Parameters
- $patron : array<string|int, mixed>
-
The patron array from patronLogin
Tags
Return values
array<string|int, mixed> —Array of the patron's transactions on success.
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 certain record.
Parameters
- $id : string
-
The record id to retrieve the holdings for
Tags
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> $idLst) : array<string|int, mixed>
This is responsible for retrieving the status information for a collection of records.
Parameters
- $idLst : 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>
NOTE: This function needs to be modified only if Koha has suppressed records in OPAC view
Tags
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, null 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 —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)