ExternalVuFind
in package
implements
LoggerAwareInterface
Uses
CachingDownloaderAwareTrait, LoggerAwareTrait
External VuFind API connection class.
Tags
Interfaces, Classes, Traits and Enums
- LoggerAwareInterface
Table of Contents
- $baseUrl : string
- Base URL of the LibGuides API
- $cacheOptionsFile : mixed
- Cache Options file. This can be overridden by child classes to declare which .ini file contains the $cacheOptionsSection above.
- $cacheOptionsSection : string
- Cache Options Section. This can be overridden by child classes to declare a section in config.ini which will be parsed to override default settings.
- $cachingDownloader : CachingDownloader
- Caching downloader
- $downloaderCacheId : string
- Cache ID. This can be overridden by child classes if they want to use a separate cache.
- __construct() : mixed
- Constructor
- search() : array<string|int, mixed>
- Execute a search against the remote VuFind API.
- setBaseUrl() : void
- Set the API base URL.
- setCachingDownloader() : void
- Set caching downloader
- debug() : void
- Log a debug message.
- log() : void
- Send a message to the logger.
- logError() : void
- Log an error message.
- logWarning() : void
- Log a warning message.
Properties
$baseUrl
Base URL of the LibGuides API
protected
string
$baseUrl
= null
$cacheOptionsFile
Cache Options file. This can be overridden by child classes to declare which .ini file contains the $cacheOptionsSection above.
protected
mixed
$cacheOptionsFile
= null
$cacheOptionsSection
Cache Options Section. This can be overridden by child classes to declare a section in config.ini which will be parsed to override default settings.
protected
string
$cacheOptionsSection
= null
Note that the prefix "Cache_" will be prepended on this string.
$cachingDownloader
Caching downloader
protected
CachingDownloader
$cachingDownloader
= null
$downloaderCacheId
Cache ID. This can be overridden by child classes if they want to use a separate cache.
protected
string
$downloaderCacheId
= 'downloader'
Methods
__construct()
Constructor
public
__construct(CachingDownloader $cachingDownloader) : mixed
Parameters
- $cachingDownloader : CachingDownloader
-
The caching downloader
Return values
mixed —search()
Execute a search against the remote VuFind API.
public
search(string $queryString, string $requestParam, int $limit[, array<string|int, mixed> $searchFilters = [] ]) : array<string|int, mixed>
Parameters
- $queryString : string
-
Query string
- $requestParam : string
-
Request parameter for the query string
- $limit : int
-
Maximum number of results to return
- $searchFilters : array<string|int, mixed> = []
-
Query filters
Return values
array<string|int, mixed> —The JSON-decoded response from the API.
setBaseUrl()
Set the API base URL.
public
setBaseUrl(string $baseUrl) : void
Parameters
- $baseUrl : string
-
The base url
Return values
void —setCachingDownloader()
Set caching downloader
public
setCachingDownloader( $cachingDownloader) : void
Parameters
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 —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?