protected function GroupMenuBlock::getGroupMenus in Group Menu 8
Gets group menu names from group ID.
Parameters
\Drupal\group\Entity\GroupInterface $group: The group you want to load menus for.
Return value
\Drupal\system\MenuInterface[] An array of menu objects keyed by menu name.
1 call to GroupMenuBlock::getGroupMenus()
- GroupMenuBlock::build in modules/
groupmenu_block/ src/ Plugin/ Block/ GroupMenuBlock.php - Builds and returns the renderable array for this block plugin.
File
- modules/
groupmenu_block/ src/ Plugin/ Block/ GroupMenuBlock.php, line 66
Class
- GroupMenuBlock
- Provides a block for displaying group menus.
Namespace
Drupal\groupmenu_block\Plugin\BlockCode
protected function getGroupMenus(GroupInterface $group) {
return \Drupal::service('groupmenu.menu')
->loadUserGroupMenusByGroup('view', $group
->id());
}