You are here

public function TaxonomyMenu::buildMenuPluginId in Taxonomy menu 8.3

Generates a menu link id for the taxonomy term.

Parameters

\Drupal\taxonomy\TermInterface $term: Term to build menu item for.

bool $include_base_plugin_id: Include base plugin id in menu item id.

Return value

string A unique string id for the menu item.

Overrides TaxonomyMenuInterface::buildMenuPluginId

2 calls to TaxonomyMenu::buildMenuPluginId()
TaxonomyMenu::buildMenuDefinition in src/Entity/TaxonomyMenu.php
Generate a menu link plugin definition for a taxonomy term.
TaxonomyMenu::getLinks in src/Entity/TaxonomyMenu.php
Get menu link plugin definitions.

File

src/Entity/TaxonomyMenu.php, line 232

Class

TaxonomyMenu
Defines the TaxonomyMenu entity.

Namespace

Drupal\taxonomy_menu\Entity

Code

public function buildMenuPluginId(TermInterface $term, $include_base_plugin_id = TRUE) {
  $plugin_id = '';
  if ($include_base_plugin_id) {
    $plugin_id .= 'taxonomy_menu.menu_link:';
  }
  $plugin_id .= 'taxonomy_menu.menu_link.' . $this
    ->id() . '.' . $term
    ->id();
  return $plugin_id;
}