public MenuTreeStorage::loadSubtreeData($id, $max_relative_depth = NULL)
Loads a subtree rooted by the given ID.
The returned links are structured like those from loadTreeData().
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.
array An array with 2 elements:
Overrides MenuTreeStorageInterface::loadSubtreeData
public function loadSubtreeData($id, $max_relative_depth = NULL) { $tree = array(); $root = $this->loadFull($id); if (!$root) { return $tree; } $parameters = new MenuTreeParameters(); $parameters->setRoot($id)->onlyEnabledLinks(); return $this->loadTreeData($root['menu_name'], $parameters); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!MenuTreeStorage.php/function/MenuTreeStorage::loadSubtreeData/8.1.x