function TermStorageInterface::loadTree

Same name in other branches
  1. 8.9.x core/modules/taxonomy/src/TermStorageInterface.php \Drupal\taxonomy\TermStorageInterface::loadTree()
  2. 10 core/modules/taxonomy/src/TermStorageInterface.php \Drupal\taxonomy\TermStorageInterface::loadTree()
  3. 11.x core/modules/taxonomy/src/TermStorageInterface.php \Drupal\taxonomy\TermStorageInterface::loadTree()

Finds all terms in a given vocabulary ID.

Parameters

string $vid: Vocabulary ID to retrieve terms for.

int $parent: The term ID under which to generate the tree. If 0, generate the tree for the entire vocabulary.

int $max_depth: The number of levels of the tree to return. Leave NULL to return all levels.

bool $load_entities: If TRUE, a full entity load will occur on the term objects. Otherwise they are partial objects queried directly from the {taxonomy_term_data} table to save execution time and memory consumption when listing large numbers of terms. Defaults to FALSE.

Return value

object[]|\Drupal\taxonomy\TermInterface[] A numerically indexed array of term objects that are the children of the vocabulary $vid.

1 method overrides TermStorageInterface::loadTree()
TermStorage::loadTree in core/modules/taxonomy/src/TermStorage.php
Finds all terms in a given vocabulary ID.

File

core/modules/taxonomy/src/TermStorageInterface.php, line 93

Class

TermStorageInterface
Defines an interface for taxonomy_term entity storage classes.

Namespace

Drupal\taxonomy

Code

public function loadTree($vid, $parent = 0, $max_depth = NULL, $load_entities = FALSE);

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