function MenuTreeStorage::loadSubtreeData

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadSubtreeData()
  2. 10 core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadSubtreeData()
  3. 8.9.x core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::loadSubtreeData()

File

core/lib/Drupal/Core/Menu/MenuTreeStorage.php, line 1022

Class

MenuTreeStorage
Provides a menu tree storage using the database.

Namespace

Drupal\Core\Menu

Code

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.