RecommendListener
in package
Recommend listener.
Tags
Table of Contents
- $config : array<string|int, mixed>
- Recommendation configuration.
- $objects : array<string|int, mixed>
- Recommendation modules, indexed by location.
- $pluginManager : PluginManager
- Recommendation module plugin manager.
- $searchId : int
- The ID of the search for which this listener should respond. Value is set by \VuFind\Search\SearchRunner and makes sure that each search run by the runner is handled by its own independent RecommendListener. Otherwise, the wrong recommendations might be injected into the wrong objects!
- __construct() : mixed
- Constructor.
- attach() : void
- Attach listener to shared event manager.
- onSearchComplete() : EventInterface
- Inject additional spelling suggestions.
- onSearchConfigured() : EventInterface
- Set up recommendation modules.
- setConfig() : void
- Set configuration
Properties
$config
Recommendation configuration.
protected
array<string|int, mixed>
$config
= []
$objects
Recommendation modules, indexed by location.
protected
array<string|int, mixed>
$objects
= []
$pluginManager
Recommendation module plugin manager.
protected
PluginManager
$pluginManager
$searchId
The ID of the search for which this listener should respond. Value is set by \VuFind\Search\SearchRunner and makes sure that each search run by the runner is handled by its own independent RecommendListener. Otherwise, the wrong recommendations might be injected into the wrong objects!
protected
int
$searchId
Methods
__construct()
Constructor.
public
__construct(PluginManager $pluginManager, int $searchId) : mixed
Parameters
- $pluginManager : PluginManager
-
Plugin manager for recommendation modules
- $searchId : int
-
The ID of the search for which this listener should respond
Return values
mixed —attach()
Attach listener to shared event manager.
public
attach(SharedEventManagerInterface $manager) : void
Parameters
- $manager : SharedEventManagerInterface
-
Shared event manager
Return values
void —onSearchComplete()
Inject additional spelling suggestions.
public
onSearchComplete(EventInterface $event) : EventInterface
Parameters
- $event : EventInterface
-
Event
Return values
EventInterface —onSearchConfigured()
Set up recommendation modules.
public
onSearchConfigured(EventInterface $event) : EventInterface
Parameters
- $event : EventInterface
-
Event
Return values
EventInterface —setConfig()
Set configuration
public
setConfig(array<string|int, mixed> $config) : void
Parameters
- $config : array<string|int, mixed>
-
Configuration array