You are here

public function CoreViewsFacetSourceBase::__construct in Core Views Facets 8

Constructs a CoreViewsContextualFilter 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\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity manager.

\Symfony\Component\HttpFoundation\Request $request: The master Request.

\Drupal\Core\Routing\RouteProviderInterface $route_provider: The route provider.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

\Drupal\views\ViewExecutableFactory $executable_factory: The view executable factory.

\Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager: The entity field manager.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides FacetSourcePluginBase::__construct

2 calls to CoreViewsFacetSourceBase::__construct()
CoreViewsContextualFilter::__construct in src/Plugin/facets/facet_source/CoreViewsContextualFilter.php
Constructs a CoreViewsContextualFilter object.
CoreViewsExposedFilter::__construct in src/Plugin/facets/facet_source/CoreViewsExposedFilter.php
Constructs a CoreViewsContextualFilter object.
2 methods override CoreViewsFacetSourceBase::__construct()
CoreViewsContextualFilter::__construct in src/Plugin/facets/facet_source/CoreViewsContextualFilter.php
Constructs a CoreViewsContextualFilter object.
CoreViewsExposedFilter::__construct in src/Plugin/facets/facet_source/CoreViewsExposedFilter.php
Constructs a CoreViewsContextualFilter object.

File

src/Plugin/facets/facet_source/CoreViewsFacetSourceBase.php, line 100

Class

CoreViewsFacetSourceBase
Provide common functions for core Views based facet sources.

Namespace

Drupal\core_views_facets\Plugin\facets\facet_source

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, QueryTypePluginManager $query_type_plugin_manager, EntityTypeManagerInterface $entity_type_manager, Request $request, RouteProviderInterface $route_provider, RouteMatchInterface $route_match, ViewExecutableFactory $executable_factory, EntityFieldManagerInterface $entity_field_manager) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $query_type_plugin_manager);
  $this->entityTypeManager = $entity_type_manager;
  $this->request = $request;
  $this->routeProvider = $route_provider;
  $this->routeMatch = $route_match;

  // Load the view.

  /** @var \Drupal\views\ViewEntityInterface $view */
  $view = $this->entityTypeManager
    ->getStorage('view')
    ->load($plugin_definition['view_id']);
  $this->view = $executable_factory
    ->get($view);
  $this->view
    ->setDisplay($plugin_definition['view_display']);
  $this->entityFieldManager = $entity_field_manager;
}