You are here

protected function EntityReferenceFacetFormatterBase::getFacet in Entity Reference Facet Link 8

Gets the configured facet entity.

Return value

\Drupal\facets\FacetInterface|null The configured facet or null if not set.

3 calls to EntityReferenceFacetFormatterBase::getFacet()
EntityReferenceFacetFormatterBase::calculateDependencies in src/Plugin/Field/FieldFormatter/EntityReferenceFacetFormatterBase.php
Calculates dependencies for the configured plugin.
EntityReferenceFacetFormatterBase::settingsSummary in src/Plugin/Field/FieldFormatter/EntityReferenceFacetFormatterBase.php
Returns a short summary for the current formatter settings.
EntityReferenceFacetFormatterBase::viewElements in src/Plugin/Field/FieldFormatter/EntityReferenceFacetFormatterBase.php
Builds a renderable array for a field value.

File

src/Plugin/Field/FieldFormatter/EntityReferenceFacetFormatterBase.php, line 202

Class

EntityReferenceFacetFormatterBase

Namespace

Drupal\entity_reference_facet_link\Plugin\Field\FieldFormatter

Code

protected function getFacet() {
  if (!isset($this->facet)) {
    $this->facet = $this->facetStorage
      ->load($this
      ->getSetting('facet'));
  }
  return $this->facet;
}