You are here

public function Vocabulary::getHierarchy in Drupal 8

Returns the vocabulary hierarchy.

Return value

int The vocabulary hierarchy.

Overrides VocabularyInterface::getHierarchy

Deprecated

in drupal:8.7.0 and is removed from drupal:9.0.0. Use \Drupal\taxonomy\TermStorage::getVocabularyHierarchyType() instead.

File

core/modules/taxonomy/src/Entity/Vocabulary.php, line 93

Class

Vocabulary
Defines the taxonomy vocabulary entity.

Namespace

Drupal\taxonomy\Entity

Code

public function getHierarchy() {
  @trigger_error('\\Drupal\\taxonomy\\VocabularyInterface::getHierarchy() is deprecated in Drupal 8.7.x and will be removed before Drupal 9.0.x. Use \\Drupal\\taxonomy\\TermStorage::getVocabularyHierarchyType() instead.', E_USER_DEPRECATED);
  return $this
    ->entityTypeManager()
    ->getStorage('taxonomy_term')
    ->getVocabularyHierarchyType($this
    ->id());
}