function MenuTreeStorageInterface::loadSubtreeData

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

Loads a subtree rooted by the given ID.

The returned links are structured like those from loadTreeData().

Parameters

string $id: The menu link plugin ID.

int $max_relative_depth: (optional) The maximum depth of child menu links relative to the passed in. Defaults to NULL, in which case the full subtree will be returned.

Return value

array An array with 2 elements:

  • subtree: A fully built menu tree element or FALSE.
  • route_names: An array of all route names used in the subtree.
1 method overrides MenuTreeStorageInterface::loadSubtreeData()
MenuTreeStorage::loadSubtreeData in core/lib/Drupal/Core/Menu/MenuTreeStorage.php
Loads a subtree rooted by the given ID.

File

core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php, line 189

Class

MenuTreeStorageInterface
Defines an interface for storing a menu tree containing menu link IDs.

Namespace

Drupal\Core\Menu

Code

public function loadSubtreeData($id, $max_relative_depth = NULL);

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