You are here

protected function MenuSelectTreeBuilder::getMenuKey in Menu Select 8

Same name and namespace in other branches
  1. 2.0.x src/MenuSelectTreeBuilder.php \Drupal\menu_select\MenuSelectTreeBuilder::getMenuKey()

Get the menu key, the combination of the menu and menu link plugin ID.

Parameters

string $menu_id: The menu ID.

\Drupal\Core\Menu\MenuLinkInterface $link: (Optional) The link.

Return value

string The menu key.

2 calls to MenuSelectTreeBuilder::getMenuKey()
MenuSelectTreeBuilder::buildNestedMenu in src/MenuSelectTreeBuilder.php
Function to generate an array of the full menu.
MenuSelectTreeBuilder::buildRenderedMenu in src/MenuSelectTreeBuilder.php
Builds a renderable array of the given menu tree.

File

src/MenuSelectTreeBuilder.php, line 172

Class

MenuSelectTreeBuilder
A service for building out the menu trees used in menu select.

Namespace

Drupal\menu_select

Code

protected function getMenuKey($menu_id, MenuLinkInterface $link = NULL) {
  return sprintf('%s:%s', $menu_id, $link ? $link
    ->getPluginId() : '');
}