public function Drupal8::taxonomyLoadTree in Realistic Dummy Content 7.2
Same name and namespace in other branches
- 8.2 api/src/Framework/Drupal8.php \Drupal\realistic_dummy_content_api\Framework\Drupal8::taxonomyLoadTree()
- 3.x api/src/Framework/Drupal8.php \Drupal\realistic_dummy_content_api\Framework\Drupal8::taxonomyLoadTree()
File
- api/
src/ Framework/ Drupal8.php, line 451
Class
- Drupal8
- Drupal 8-specific code.
Namespace
Drupal\realistic_dummy_content_api\FrameworkCode
public function taxonomyLoadTree($vocabulary) {
$terms = \Drupal::entityTypeManager()
->getStorage('taxonomy_term')
->loadTree($this
->vocabularyIdentifier($vocabulary));
$tids = array_map(function ($a) {
return $a->tid;
}, $terms);
return Term::loadMultiple($tids);
}