public TermStorageInterface::loadTree($vid, $parent = 0, $max_depth = NULL, $load_entities = FALSE)
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[] An array of term objects that are the children of the vocabulary $vid.
File
- core/modules/taxonomy/src/TermStorageInterface.php, line 84
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);
Please login to continue.