function TermStorage::loadAllParents

Same name and namespace in other branches
  1. 9 core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::loadAllParents()
  2. 10 core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::loadAllParents()
  3. 11.x core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::loadAllParents()

Overrides TermStorageInterface::loadAllParents

File

core/modules/taxonomy/src/TermStorage.php, line 163

Class

TermStorage
Defines a Controller class for taxonomy terms.

Namespace

Drupal\taxonomy

Code

public function loadAllParents($tid) {
    
    /** @var \Drupal\taxonomy\TermInterface $term */
    return !empty($tid) && ($term = $this->load($tid)) ? $this->getAncestors($term) : [];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.