You are here

public function MenuTree::__construct in Taxonomy Facets 8

File

src/MenuTree.php, line 16

Class

MenuTree

Namespace

Drupal\taxonomy_facets

Code

public function __construct($vid) {
  $this->vid = $vid;

  // Get fully loaded terms for all applied filters.
  $this->filtersObject = taxonomy_facets_get_selected_filters();

  // Get the term id of the filter that belongs to given vocabulary.
  if ($this->filtersObject) {
    $this->tidSelected = $this->filtersObject
      ->getSelectedFilterForVocabulary($vid);
    $this->termSelected = $this->filtersObject
      ->getSelectedFilterTermForVocabulary($vid);
  }
  $this
    ->buildMenyTreeHeader();
  $this
    ->buildMenuTreeRecursively(0);
}