MenuParentFormSelector::getParentDepthLimit

protected MenuParentFormSelector::getParentDepthLimit($id)

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.

File

core/lib/Drupal/Core/Menu/MenuParentFormSelector.php, line 113

Class

MenuParentFormSelector
Default implementation of the menu parent form selector service.

Namespace

Drupal\Core\Menu

Code

protected function getParentDepthLimit($id) {
  if ($id) {
    $limit = $this->menuLinkTree->maxDepth() - $this->menuLinkTree->getSubtreeHeight($id);
  }
  else {
    $limit = $this->menuLinkTree->maxDepth() - 1;
  }
  return $limit;
}
doc_Drupal
2016-10-29 09:27:26
Comments
Leave a Comment

Please login to continue.