OpenLibrarySubjects
in package
implements
RecommendInterface, HttpServiceAwareInterface
Uses
HttpServiceAwareTrait
OpenLibrarySubjects Recommendations Module
This class provides recommendations by doing a search of the catalog; useful for displaying catalog recommendations in other modules (i.e. Summon, Web, etc.)
Tags
Interfaces, Classes, Traits and Enums
- RecommendInterface
- Search Recommendations Interface
- HttpServiceAwareInterface
Table of Contents
- $limit : int
- Search limit
- $pubFilter : string
- Field to use for date filtering
- $publishedIn : string
- Date filter to apply
- $requestParam : string
- Parameter to use for search terms
- $result : array<string|int, mixed>|bool
- Result of search (false if none)
- $subject : string
- Subject to search for
- $subjectTypes : array<string|int, mixed>
- Subject types to use
- getResult() : bool|array<string|int, mixed>
- Get the results of the subject query -- false if none, otherwise an array with 'worksArray' and 'subject' keys.
- init() : void
- Called before the Search Results object performs its main search (specifically, in response to \VuFind\Search\SearchRunner::EVENT_CONFIGURED).
- process() : void
- Called after the Search Results object has performed its main search. This may be used to extract necessary information from the Search Results object or to perform completely unrelated processing.
- setConfig() : void
- Store the configuration of the recommendation module.
- getPublishedDates() : string
- Support function to get publication date range. Return string in the form "YYYY-YYYY"
Properties
$limit
Search limit
protected
int
$limit
$pubFilter
Field to use for date filtering
protected
string
$pubFilter
$publishedIn
Date filter to apply
protected
string
$publishedIn
= ''
$requestParam
Parameter to use for search terms
protected
string
$requestParam
$result
Result of search (false if none)
protected
array<string|int, mixed>|bool
$result
= false
$subject
Subject to search for
protected
string
$subject
$subjectTypes
Subject types to use
protected
array<string|int, mixed>
$subjectTypes
Methods
getResult()
Get the results of the subject query -- false if none, otherwise an array with 'worksArray' and 'subject' keys.
public
getResult() : bool|array<string|int, mixed>
Return values
bool|array<string|int, mixed> —init()
Called before the Search Results object performs its main search (specifically, in response to \VuFind\Search\SearchRunner::EVENT_CONFIGURED).
public
init(Params $params, Parameters $request) : void
This method is responsible for setting search parameters needed by the recommendation module and for reading any existing search parameters that may be needed.
Parameters
- $params : Params
-
Search parameter object
- $request : Parameters
-
Parameter object representing user request.
Return values
void —process()
Called after the Search Results object has performed its main search. This may be used to extract necessary information from the Search Results object or to perform completely unrelated processing.
public
process(Results $results) : void
Parameters
- $results : Results
-
Search results object
Return values
void —setConfig()
Store the configuration of the recommendation module.
public
setConfig(string $settings) : void
Parameters
- $settings : string
-
Settings from searches.ini.
Return values
void —getPublishedDates()
Support function to get publication date range. Return string in the form "YYYY-YYYY"
protected
getPublishedDates(string $field, Base $params, Parameters $request) : string
Parameters
- $field : string
-
Name of filter field to check for date limits
- $params : Base
-
Search parameter object
- $request : Parameters
-
Parameter object representing user request.