You are here

public function TaxonomyViewsIntegratorManager::getTermParents in Taxonomy Views Integrator 8

Wrapper method for obtaining parents of a given taxonomy term.

Parameters

\Drupal\taxonomy\TermInterface $taxonomy_term: Starting term.

Return value

array Parent terms of given term.

1 call to TaxonomyViewsIntegratorManager::getTermParents()
TaxonomyViewsIntegratorManager::getTaxonomyTermViewAndDisplayId in src/Service/TaxonomyViewsIntegratorManager.php
Return array with view and display id for current term based on settings.

File

src/Service/TaxonomyViewsIntegratorManager.php, line 109

Class

TaxonomyViewsIntegratorManager
Default implementation of TaxonomyViewsIntegratorManagerInterface.

Namespace

Drupal\tvi\Service

Code

public function getTermParents(TermInterface $taxonomy_term) {
  return $this->entityTypeManager
    ->getStorage('taxonomy_term')
    ->loadAllParents($taxonomy_term
    ->id());
}