You are here

public function GroupMenuBlock::getMenuName in Group Content Menu 8

Returns a name for the menu.

Return value

string The name of the menu.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

2 calls to GroupMenuBlock::getMenuName()
GroupMenuBlock::build in src/Plugin/Block/GroupMenuBlock.php
Builds and returns the renderable array for this block plugin.
GroupMenuBlock::getCacheTags in src/Plugin/Block/GroupMenuBlock.php
The cache tags associated with this object.

File

src/Plugin/Block/GroupMenuBlock.php, line 298

Class

GroupMenuBlock
Provides a generic Menu block.

Namespace

Drupal\group_content_menu\Plugin\Block

Code

public function getMenuName() {
  if (isset($this->menuName)) {
    return $this->menuName;
  }
  $instance = $this
    ->getMenuInstance();
  if ($instance) {
    $this->menuName = GroupContentMenuInterface::MENU_PREFIX . $instance
      ->id();
  }
  return $this->menuName;
}