function MenuTreeStorageInterface::getRootPathIds
Same name in other branches
- 9 core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php \Drupal\Core\Menu\MenuTreeStorageInterface::getRootPathIds()
- 10 core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php \Drupal\Core\Menu\MenuTreeStorageInterface::getRootPathIds()
- 11.x core/lib/Drupal/Core/Menu/MenuTreeStorageInterface.php \Drupal\Core\Menu\MenuTreeStorageInterface::getRootPathIds()
Returns all the IDs that represent the path to the root of the tree.
array(
'p1' => 1,
'p2' => 6,
'p3' => 8,
'p4' => 0,
'p5' => 0,
'p6' => 0,
'p7' => 0,
'p8' => 0,
'p9' => 0,
);
Parameters
string $id: A menu link ID.
Return value
array An associative array of IDs with keys equal to values that represents the path from the given ID to the root of the tree. If $id is an ID that exists, the returned array will at least include it. An empty array is returned if the ID does not exist in the storage. An example $id (8) with two parents (1, 6) looks like the following:
1 method overrides MenuTreeStorageInterface::getRootPathIds()
- MenuTreeStorage::getRootPathIds in core/
lib/ Drupal/ Core/ Menu/ MenuTreeStorage.php - Returns all the IDs that represent the path to the root of the tree.
File
-
core/
lib/ Drupal/ Core/ Menu/ MenuTreeStorageInterface.php, line 217
Class
- MenuTreeStorageInterface
- Defines an interface for storing a menu tree containing menu link IDs.
Namespace
Drupal\Core\MenuCode
public function getRootPathIds($id);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.