You are here

public function FacetsSummary::getFacetSource in Facets 8

Returns the plugin instance of a facet source.

Return value

\Drupal\facets\FacetSource\FacetSourcePluginInterface The plugin instance for the facet source.

Overrides FacetsSummaryInterface::getFacetSource

1 call to FacetsSummary::getFacetSource()
FacetsSummary::calculateDependencies in modules/facets_summary/src/Entity/FacetsSummary.php
Calculates dependencies and stores them in the dependency property.

File

modules/facets_summary/src/Entity/FacetsSummary.php, line 138

Class

FacetsSummary
Defines the facet summary entity.

Namespace

Drupal\facets_summary\Entity

Code

public function getFacetSource() {
  if (!$this->facet_source_instance && $this->facet_source_id) {

    /* @var $facet_source_plugin_manager \Drupal\facets\FacetSource\FacetSourcePluginManager */
    $facet_source_plugin_manager = \Drupal::service('plugin.manager.facets.facet_source');
    $this->facet_source_instance = $facet_source_plugin_manager
      ->createInstance($this->facet_source_id, [
      'facets_summary' => $this,
    ]);
  }
  return $this->facet_source_instance;
}