function MenuTreeStorage::loadSubtreeData
Same name in other branches
- 9 core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadSubtreeData()
- 10 core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadSubtreeData()
- 11.x core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadSubtreeData()
Overrides MenuTreeStorageInterface::loadSubtreeData
File
-
core/
lib/ Drupal/ Core/ Menu/ MenuTreeStorage.php, line 1018
Class
- MenuTreeStorage
- Provides a menu tree storage using the database.
Namespace
Drupal\Core\MenuCode
public function loadSubtreeData($id, $max_relative_depth = NULL) {
$tree = [];
$root = $this->loadFull($id);
if (!$root) {
return $tree;
}
$parameters = new MenuTreeParameters();
$parameters->setRoot($id)
->onlyEnabledLinks();
return $this->loadTreeData($root['menu_name'], $parameters);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.