Evergreen
extends AbstractBase
in package
implements
LoggerAwareInterface
Uses
LoggerAwareTrait
VuFind Connector for Evergreen
Written by Warren Layton at the NRCan (Natural Resources Canada) Library.
Tags
Interfaces, Classes, Traits and Enums
- LoggerAwareInterface
Table of Contents
- EVG_ITEM_STATUS_IN_TRANSIT = '6'
- Evergreen constants
- $config : array<string|int, mixed>
- Driver configuration
- $dateConverter : Converter
- Date converter object
- $db : PDO
- Database connection
- $dbName : string
- Database name
- __construct() : mixed
- Constructor
- findReserves() : array<string|int, mixed>
- Find Reserves
- getCourses() : array<string|int, mixed>
- Get Courses
- 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
- 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.
- debug() : void
- Log a debug message.
- formatDate() : string
- Format date
- log() : void
- Send a message to the logger.
- logError() : void
- Log an error message.
- logWarning() : void
- Log a warning message.
- throwAsIlsException() : never
- Rethrow the provided exception as an ILS exception.
Constants
EVG_ITEM_STATUS_IN_TRANSIT
Evergreen constants
public
mixed
EVG_ITEM_STATUS_IN_TRANSIT
= '6'
Properties
$config
Driver configuration
protected
array<string|int, mixed>
$config
= []
$dateConverter
Date converter object
protected
Converter
$dateConverter
$db
Database connection
protected
PDO
$db
$dbName
Database name
protected
string
$dbName
Methods
__construct()
Constructor
public
__construct(Converter $dateConverter) : mixed
Parameters
- $dateConverter : Converter
-
Date converter
Return values
mixed —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
Return values
array<string|int, mixed> —An array of associative arrays representing reserve items.
getCourses()
Get Courses
public
getCourses() : array<string|int, mixed>
Obtain a list of courses for use in limiting the reserves list.
Tags
Return values
array<string|int, mixed> —An associative array with key = ID, value = name.
getDepartments()
Get Departments
public
getDepartments() : array<string|int, mixed>
Obtain a list of departments for use in limiting the reserves list.
Tags
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
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.
getInstructors()
Get Instructors
public
getInstructors() : array<string|int, mixed>
Obtain a list of instructors for use in limiting the reserves list.
Tags
Return values
array<string|int, mixed> —An associative array with key = ID, value = name.
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.
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.
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
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> $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>
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 $barcode, string $passwd) : mixed
This is responsible for authenticating a patron against the catalog.
Parameters
- $barcode : string
-
The patron username OR barcode number
- $passwd : string
-
The patron 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 —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 —formatDate()
Format date
protected
formatDate(string $date) : string
This formats a date coming from Evergreen for display
Parameters
- $date : string
-
The date string to format; may be null
Tags
Return values
string —The formatted date
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 —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)