Symphony
extends AbstractBase
in package
implements
LoggerAwareInterface
Uses
LoggerAwareTrait
Symphony Web Services (symws) ILS Driver
Tags
Interfaces, Classes, Traits and Enums
- LoggerAwareInterface
Table of Contents
- $cacheManager : Manager
- Cache manager
- $config : array<string|int, mixed>
- Driver configuration
- $policies : array<string|int, mixed>
- Policy information
- $policyCache : object
- Cache for policy information
- $recordLoader : Loader
- Record loader
- __construct() : mixed
- Constructor
- cancelHolds() : mixed
- Cancel Holds
- getCancelHoldDetails() : string
- Get Cancel Hold Form
- 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
- 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
- getPickUpLocations() : array<string|int, mixed>
- Get Pick Up Locations
- getPurchaseHistory() : array<string|int, mixed>
- Get Purchase History
- getRenewDetails() : string
- Get Renew Details
- getStatus() : mixed
- Get Status
- getStatuses() : array<string|int, mixed>
- Get Statuses
- init() : void
- Initialize the driver.
- patronLogin() : mixed
- Patron Login
- placeHold() : array<string|int, mixed>
- Place Hold
- renewMyItems() : array<string|int, mixed>
- Renew My Items
- setConfig() : void
- Set configuration.
- checkSymwsVersion() : void
- Check the SymWS version, and throw an Exception if it's too old.
- debug() : void
- Log a debug message.
- getLiveStatuses() : array<string|int, mixed>
- Get Live Statuses
- getPolicyList() : array<string|int, mixed>
- Get Policy List
- getSessionToken() : string
- Return a SymWS session token for given credentials.
- getSoapClient() : object
- Return a SoapClient for the specified SymWS service.
- getSoapHeader() : object
- Return a SoapHeader for the specified login and password.
- getStatuses999Holdings() : array<string|int, mixed>
- Get Statuses from 999 Holdings Marc Tag
- libraryIsFilteredOut() : bool
- Determine if a library is excluded by LibraryFilter configuration.
- log() : void
- Send a message to the logger.
- logError() : void
- Log an error message.
- logWarning() : void
- Log a warning message.
- lookupTitleInfo() : object
- Look up title info
- makeRequest() : mixed
- Make a request to Symphony Web Services using the SOAP protocol.
- parseBoundwithLinkInfo() : array<string|int, mixed>
- Parse Bound With Link Info
- parseCallInfo() : array<string|int, mixed>
- Parse Call Info
- parseMarcHoldingsInfo() : array<string|int, mixed>
- Parse MarcHoldingInfo into VuFind items.
- parseTitleOrderInfo() : array<string|int, mixed>
- Parse Title Order Info
- throwAsIlsException() : never
- Rethrow the provided exception as an ILS exception.
- translatePolicyID() : string
- Translate a Symphony policy ID into a policy description (e.g. VIDEO-COLL => Videorecording Collection).
Properties
$cacheManager
Cache manager
protected
Manager
$cacheManager
$config
Driver configuration
protected
array<string|int, mixed>
$config
= []
$policies
Policy information
protected
array<string|int, mixed>
$policies
$policyCache
Cache for policy information
protected
object
$policyCache
= false
$recordLoader
Record loader
protected
Loader
$recordLoader
Methods
__construct()
Constructor
public
__construct(Loader $loader[, Manager $cacheManager = null ]) : mixed
Parameters
Return values
mixed —cancelHolds()
Cancel Holds
public
cancelHolds(array<string|int, mixed> $cancelDetails) : mixed
Attempts to Cancel a hold on a particular item
Parameters
- $cancelDetails : array<string|int, mixed>
-
An array of item and patron data
Return values
mixed —An array of data on each request including whether or not it was successful and a system message (if available) or boolean false on failure
getCancelHoldDetails()
Get Cancel Hold Form
public
getCancelHoldDetails(array<string|int, mixed> $holdDetails[, array<string|int, mixed> $patron = [] ]) : string
Supplies the form details required to cancel a hold
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
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 Symphony.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.
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.
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.
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 get 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) : 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.
getRenewDetails()
Get Renew Details
public
getRenewDetails(array<string|int, mixed> $checkOutDetails) : string
In order to renew an item, Symphony 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
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> $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
Tags
Return values
array<string|int, mixed> —An array of getStatus() return values on success.
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
Tags
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) : array<string|int, mixed>
Attempts to place a hold or recall on a particular item
Parameters
- $holdDetails : array<string|int, mixed>
-
An array of item and patron data
Return values
array<string|int, mixed> —An array of data on the 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 —checkSymwsVersion()
Check the SymWS version, and throw an Exception if it's too old.
protected
checkSymwsVersion() : void
Always checking at initialization would result in many unnecessary roundtrips with the SymWS server, so this method is intended to be called when an error happens that might be correctable by upgrading SymWS. In such a case it will produce a potentially more helpful error message than the original error would have.
Tags
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 —getLiveStatuses()
Get Live Statuses
protected
getLiveStatuses(array<string|int, mixed> $ids) : array<string|int, mixed>
Protected support method for retrieving a list of item statuses from symws.
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 parseCallInfo() return values on success, an empty array otherwise.
getPolicyList()
Get Policy List
protected
getPolicyList(string $policyType) : array<string|int, mixed>
Protected support method for getting a list of policies.
Parameters
- $policyType : string
-
Symphony policy code for type of policy
Return values
array<string|int, mixed> —An associative array of policy codes and descriptions.
getSessionToken()
Return a SymWS session token for given credentials.
protected
getSessionToken(string $login[, string|null $password = null ][, bool $reset = false ]) : string
To avoid needing to repeatedly log in the same user, cache acquired session tokens by the credentials provided. If the cached session token is expired or otherwise defective, the caller can use the $reset parameter.
Parameters
- $login : string
-
The login account name
- $password : string|null = null
-
The login password, or null for no password
- $reset : bool = false
-
If true, replace any currently cached token
Return values
string —The session token
getSoapClient()
Return a SoapClient for the specified SymWS service.
protected
getSoapClient(string $service) : object
SoapClient instantiation fetches and parses remote files, so this method instantiates SoapClients lazily and keeps them around so that they can be reused for multiple requests.
Parameters
- $service : string
-
The name of the SymWS service
Return values
object —The SoapClient object for the specified service
getSoapHeader()
Return a SoapHeader for the specified login and password.
protected
getSoapHeader([mixed $login = null ][, mixed $password = null ][, bool $reset = false ]) : object
Parameters
- $login : mixed = null
-
The login account name if logging in, otherwise null
- $password : mixed = null
-
The login password if logging in, otherwise null
- $reset : bool = false
-
Whether or not the session token should be reset
Return values
object —The SoapHeader object
getStatuses999Holdings()
Get Statuses from 999 Holdings Marc Tag
protected
getStatuses999Holdings(array<string|int, mixed> $ids) : array<string|int, mixed>
Protected support method for parsing status info from the marc record
Parameters
- $ids : array<string|int, mixed>
-
The array of record ids to retrieve the item info for
Return values
array<string|int, mixed> —An associative array of items
libraryIsFilteredOut()
Determine if a library is excluded by LibraryFilter configuration.
protected
libraryIsFilteredOut(string $libraryID) : bool
Parameters
- $libraryID : string
-
the ID of the library in question
Return values
bool —true if excluded, false if not
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 —lookupTitleInfo()
Look up title info
protected
lookupTitleInfo(array<string|int, mixed> $ids) : object
Protected support method for parsing the call info into items.
Parameters
- $ids : array<string|int, mixed>
-
The array of record ids to retrieve the item info for
Return values
object —Result of the "lookupTitleInfo" call to the standard service
makeRequest()
Make a request to Symphony Web Services using the SOAP protocol.
protected
makeRequest(string $service, string $operation[, array<string|int, mixed> $parameters = [] ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $service : string
-
the SymWS service name
- $operation : string
-
the SymWS operation name
- $parameters : array<string|int, mixed> = []
-
the request parameters for the operation
- $options : array<string|int, mixed> = []
-
An associative array of additional options:
- 'login': login to use for the operation; omit for configured default credentials or anonymous
- 'password': password associated with login; omit for no password
- 'header': SoapHeader to use for the request; omit to handle automatically
Return values
mixed —the result of the SOAP call
parseBoundwithLinkInfo()
Parse Bound With Link Info
protected
parseBoundwithLinkInfo(object $boundwithLinkInfos, int $ckey) : array<string|int, mixed>
Protected support method for parsing bound with link information.
Parameters
- $boundwithLinkInfos : object
-
The boundwithLinkInfos object of the title
- $ckey : int
-
The catalog key of the title in the catalog
Return values
array<string|int, mixed> —An array of parseCallInfo() return values on success, an empty array otherwise.
parseCallInfo()
Parse Call Info
protected
parseCallInfo(object $callInfos, int $titleID[, bool $is_holdable = false ][, int $bound_in = null ]) : array<string|int, mixed>
Protected support method for parsing the call info into items.
Parameters
- $callInfos : object
-
The call info of the title
- $titleID : int
-
The catalog key of the title in the catalog
- $is_holdable : bool = false
-
Whether or not the title is holdable
- $bound_in : int = null
-
The ID of the parent title
Return values
array<string|int, mixed> —An array of items, an empty array otherwise
parseMarcHoldingsInfo()
Parse MarcHoldingInfo into VuFind items.
protected
parseMarcHoldingsInfo(object $marcHoldingsInfos, int $titleID) : array<string|int, mixed>
Parameters
- $marcHoldingsInfos : object
-
MarcHoldingInfo, from TitleInfo
- $titleID : int
-
The catalog key of the title record
Return values
array<string|int, mixed> —an array (possibly empty) of VuFind items
parseTitleOrderInfo()
Parse Title Order Info
protected
parseTitleOrderInfo(object $titleOrderInfos, int $titleID) : array<string|int, mixed>
Protected support method for parsing order info.
Parameters
- $titleOrderInfos : object
-
The titleOrderInfo object of the title
- $titleID : int
-
The ID of the title in the catalog
Return values
array<string|int, mixed> —An array of items that are on order, an empty array otherwise.
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
Return values
never —translatePolicyID()
Translate a Symphony policy ID into a policy description (e.g. VIDEO-COLL => Videorecording Collection).
protected
translatePolicyID(string $policyType, string $policyID) : string
In order to minimize roundtrips with the SymWS server, we fetch more than was requested and cache the results. At time of writing, SymWS did not appear to support retrieving policies of multiple types simultaneously, so we currently fetch only all policies of one type at a time.
Parameters
- $policyType : string
-
The policy type, e.g. LOCN or LIBR.
- $policyID : string
-
The policy ID, e.g. VIDEO-COLL or SWEM.
Tags
Return values
string —The policy description, if found, or the policy ID, if not.