function MenuParentFormSelector::getParentDepthLimit
Same name in other branches
- 9 core/lib/Drupal/Core/Menu/MenuParentFormSelector.php \Drupal\Core\Menu\MenuParentFormSelector::getParentDepthLimit()
- 8.9.x core/lib/Drupal/Core/Menu/MenuParentFormSelector.php \Drupal\Core\Menu\MenuParentFormSelector::getParentDepthLimit()
- 11.x core/lib/Drupal/Core/Menu/MenuParentFormSelector.php \Drupal\Core\Menu\MenuParentFormSelector::getParentDepthLimit()
Returns the maximum depth of the possible parents of the menu link.
Parameters
string $id: The menu link plugin ID or an empty value for a new link.
Return value
int The depth related to the depth of the given menu link.
1 call to MenuParentFormSelector::getParentDepthLimit()
- MenuParentFormSelector::getParentSelectOptions in core/
lib/ Drupal/ Core/ Menu/ MenuParentFormSelector.php
File
-
core/
lib/ Drupal/ Core/ Menu/ MenuParentFormSelector.php, line 113
Class
- MenuParentFormSelector
- Default implementation of the menu parent form selector service.
Namespace
Drupal\Core\MenuCode
protected function getParentDepthLimit($id) {
if ($id) {
$limit = $this->menuLinkTree
->maxDepth() - $this->menuLinkTree
->getSubtreeHeight($id);
}
else {
$limit = $this->menuLinkTree
->maxDepth() - 1;
}
return $limit;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.