function MenuTreeStorage::loadAllChildren

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

File

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

Class

MenuTreeStorage
Provides a menu tree storage using the database.

Namespace

Drupal\Core\Menu

Code

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.