function MenuTreeStorage::loadAllChildren
Same name in other branches
- 9 core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadAllChildren()
- 8.9.x core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadAllChildren()
- 10 core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadAllChildren()
Overrides MenuTreeStorageInterface::loadAllChildren
File
-
core/
lib/ Drupal/ Core/ Menu/ MenuTreeStorage.php, line 1058
Class
- MenuTreeStorage
- Provides a menu tree storage using the database.
Namespace
Drupal\Core\MenuCode
public function loadAllChildren($id, $max_relative_depth = NULL) {
$parameters = new MenuTreeParameters();
$parameters->setRoot($id)
->excludeRoot()
->setMaxDepth($max_relative_depth)
->onlyEnabledLinks();
$links = $this->loadLinks(NULL, $parameters);
foreach ($links as $id => $link) {
$links[$id] = $this->prepareLink($link);
}
return $links;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.