VuFind API Documentation

ExternalVuFind
in package
implements LoggerAwareInterface Uses CachingDownloaderAwareTrait, LoggerAwareTrait

External VuFind API connection class.

Tags
category

VuFind

author

Maccabee Levine msl321@lehigh.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link
https://vufind.org

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.

$downloaderCacheId

Cache ID. This can be overridden by child classes if they want to use a separate cache.

protected string $downloaderCacheId = 'downloader'

Methods

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
$cachingDownloader :

CachingDownloader

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?

Return values
void

Search results