function MenuTreeStorage::doBuildTreeData

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

Prepares the data for calling $this->treeDataRecursive().

1 call to MenuTreeStorage::doBuildTreeData()
MenuTreeStorage::loadTreeData in core/lib/Drupal/Core/Menu/MenuTreeStorage.php
Loads a menu link tree from the storage.

File

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

Class

MenuTreeStorage
Provides a menu tree storage using the database.

Namespace

Drupal\Core\Menu

Code

protected function doBuildTreeData(array $links, array $parents = [], $depth = 1) {
    // Reverse the array so we can use the more efficient array_pop() function.
    $links = array_reverse($links);
    return $this->treeDataRecursive($links, $parents, $depth);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.