HierarchicalFacetListener
in package
Uses
GetServiceTrait
Solr hierarchical facet handling listener.
Tags
Table of Contents
- $backend : BackendInterface
- Backend.
- $displayStyles : array<string|int, mixed>
- Facet display styles.
- $facetConfig : Config
- Facet configuration.
- $facetHelper : HierarchicalFacetHelper
- Facet helper.
- $separators : array<string|int, mixed>
- Hierarchy level separators
- $serviceLocator : ContainerInterface
- Service manager
- $translatedFacets : array<string|int, mixed>
- Facet settings
- $translatedFacetsTextDomains : array<string|int, mixed>
- Text domains for translated facets
- __construct() : void
- Constructor.
- attach() : void
- Attach listener to shared event manager.
- getService() : T
- Retrieve a service
- onSearchPost() : EventInterface
- Format hierarchical facets accordingly
- formatFacetField() : string
- Format a facet field according to the settings
- processHierarchicalFacets() : void
- Process hierarchical facets and format them accordingly
Properties
$backend
Backend.
protected
BackendInterface
$backend
$displayStyles
Facet display styles.
protected
array<string|int, mixed>
$displayStyles
$facetConfig
Facet configuration.
protected
Config
$facetConfig
$facetHelper
Facet helper.
protected
HierarchicalFacetHelper
$facetHelper
$separators
Hierarchy level separators
protected
array<string|int, mixed>
$separators
$serviceLocator
Service manager
protected
ContainerInterface
$serviceLocator
$translatedFacets
Facet settings
protected
array<string|int, mixed>
$translatedFacets
= []
$translatedFacetsTextDomains
Text domains for translated facets
protected
array<string|int, mixed>
$translatedFacetsTextDomains
= []
Methods
__construct()
Constructor.
public
__construct(BackendInterface $backend, ServiceLocatorInterface $serviceLocator, string $facetConfig) : void
Parameters
- $backend : BackendInterface
-
Search backend
- $serviceLocator : ServiceLocatorInterface
-
Service locator
- $facetConfig : string
-
Facet config file id
Return values
void —attach()
Attach listener to shared event manager.
public
attach(SharedEventManagerInterface $manager) : void
Parameters
- $manager : SharedEventManagerInterface
-
Shared event manager
Return values
void —getService()
Retrieve a service
public
getService(class-string<\VuFind\Service\T> $name) : T
Parameters
- $name : class-string<\VuFind\Service\T>
-
Name of service to retrieve
Tags
Return values
T —onSearchPost()
Format hierarchical facets accordingly
public
onSearchPost(EventInterface $event) : EventInterface
Parameters
- $event : EventInterface
-
Event
Return values
EventInterface —formatFacetField()
Format a facet field according to the settings
protected
formatFacetField(string $facet, string $value) : string
Parameters
- $facet : string
-
Facet field
- $value : string
-
Facet value
Return values
string —Formatted field
processHierarchicalFacets()
Process hierarchical facets and format them accordingly
protected
processHierarchicalFacets(EventInterface $event) : void
Parameters
- $event : EventInterface
-
Event