You are here

private function MenuTree::menuItemInChildrenLeafs in Taxonomy Facets 8

Check if selected filer is somewhere in the children leafs.

1 call to MenuTree::menuItemInChildrenLeafs()
MenuTree::buildMenuTreeRecursively in src/MenuTree.php

File

src/MenuTree.php, line 188

Class

MenuTree

Namespace

Drupal\taxonomy_facets

Code

private function menuItemInChildrenLeafs($tid) {
  $all_children = \Drupal::entityTypeManager()
    ->getStorage('taxonomy_term')
    ->loadTree($this->vid, $tid);
  foreach ($all_children as $child) {
    if ($this->tidSelected == $child->tid) {
      return TRUE;
    }
  }
  return FALSE;
}