function TermStorage::getChildren
Same name in other branches
- 9 core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::getChildren()
- 10 core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::getChildren()
- 11.x core/modules/taxonomy/src/TermStorage.php \Drupal\taxonomy\TermStorage::getChildren()
Returns all children terms of this term.
@internal @todo Refactor away when TreeInterface is introduced.
Return value
\Drupal\taxonomy\TermInterface[] A list of children taxonomy term entities keyed by term ID.
1 call to TermStorage::getChildren()
- TermStorage::loadChildren in core/
modules/ taxonomy/ src/ TermStorage.php - Finds all children of a term ID.
File
-
core/
modules/ taxonomy/ src/ TermStorage.php, line 211
Class
- TermStorage
- Defines a Controller class for taxonomy terms.
Namespace
Drupal\taxonomyCode
public function getChildren(TermInterface $term) {
$query = \Drupal::entityQuery('taxonomy_term')->condition('parent', $term->id());
return static::loadMultiple($query->execute());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.