You are here

public function AddSearchMetaEventSubscriber::__construct in JSON:API Search API 8

Constructs a new event subscriber.

Parameters

Drupal\facets\FacetManager\DefaultFacetManager $facet_manager: The facet manager.

Drupal\Core\Entity\EntityTypeManager $entity_type_manager: The entity type manager.

File

modules/jsonapi_search_api_facets/src/EventSubscriber/AddSearchMetaEventSubscriber.php, line 38

Class

AddSearchMetaEventSubscriber
Event subscriber to add facets into search results.

Namespace

Drupal\jsonapi_search_api_facets\EventSubscriber

Code

public function __construct(DefaultFacetManager $facet_manager, EntityTypeManager $entity_type_manager) {
  $this->facetManager = $facet_manager;
  $this->facetStorage = $entity_type_manager
    ->getStorage('facets_facet');
}