You are here

public function SearchApiBaseFacetSource::__construct in Facets 8

Constructs a SearchApiBaseFacetSource object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\facets\QueryType\QueryTypePluginManager $query_type_plugin_manager: The query type plugin manager.

\Drupal\search_api\Utility\QueryHelper $search_results_cache: The query type plugin manager.

Overrides FacetSourcePluginBase::__construct

File

src/Plugin/facets/facet_source/SearchApiBaseFacetSource.php, line 52

Class

SearchApiBaseFacetSource
A base class for Search API facet sources.

Namespace

Drupal\facets\Plugin\facets\facet_source

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, QueryTypePluginManager $query_type_plugin_manager, QueryHelper $search_results_cache) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $query_type_plugin_manager);

  // Since defaultConfiguration() depends on the plugin definition, we need to
  // override the constructor and set the definition property before calling
  // that method.
  $this->pluginDefinition = $plugin_definition;
  $this->pluginId = $plugin_id;
  $this->configuration = $configuration;
  $this->searchApiQueryHelper = $search_results_cache;
}