You are here

public function Facet::getHierarchyInstance in Facets 8

Returns the facet hierarchy instance.

Return value

\Drupal\facets\Hierarchy\HierarchyPluginBase The plugin instance

Overrides FacetInterface::getHierarchyInstance

File

src/Entity/Facet.php, line 400

Class

Facet
Defines the facet configuration entity.

Namespace

Drupal\facets\Entity

Code

public function getHierarchyInstance() {
  if (!isset($this->hierarchy_instance)) {
    $definition = $this
      ->getHierarchy();
    $this->hierarchy_instance = $this
      ->getHierarchyManager()
      ->createInstance($definition['type'], (array) $definition['config']);
  }
  return $this->hierarchy_instance;
}