You are here

static function NodeTerms::getTermParents in Taxonomy Facets 8

File

src/NodeTerms.php, line 109

Class

NodeTerms

Namespace

Drupal\taxonomy_facets

Code

static function getTermParents($tid) {
  $ancestors = \Drupal::service('entity_type.manager')
    ->getStorage("taxonomy_term")
    ->loadAllParents($tid);
  $list = [];
  foreach ($ancestors as $term) {
    $list[] = $term
      ->id();
  }
  return $list;
}