groupmenu-8.x-1.0-beta2/src/GroupMenuServiceInterface.php
src/GroupMenuServiceInterface.php
<?php
namespace Drupal\groupmenu;
use Drupal\Core\Session\AccountInterface;
use Drupal\system\MenuInterface;
/**
* Provides an interface defining a GroupMenu manager.
*/
interface GroupMenuServiceInterface {
/**
* Gets Config.
*/
public function getConfig();
/**
* Sets Config.
*
* @var string $key
* The config parameter
* @var string $value
* The value to update.
*/
public function setConfig(string $key, string $value);
/**
* A custom access check for a menu operation.
*
* @param string $op
* The operation to perform on the menu.
* @param \Drupal\system\MenuInterface $menu
* Run access checks for this menu object.
* @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account.
*
* @return \Drupal\Core\Access\AccessResult
* The access result.
*/
public function menuAccess($op, MenuInterface $menu, AccountInterface $account = NULL);
/**
* Load a list of menus where a user can perform a operation.
*
* @param string $op
* The operation to perform on the menu.
* @param \Drupal\Core\Session\AccountInterface $account
* The user to load the menus for.
*
* @return \Drupal\system\MenuInterface[]
* An array of menu objects keyed by menu name.
*/
public function loadUserGroupMenus($op, AccountInterface $account = NULL);
/**
* Load a list of menus for a group where a user can perform a operation.
*
* @param string $op
* The operation to perform on the menu.
* @param int $group_id
* The group ID to load the menus from.
* @param \Drupal\Core\Session\AccountInterface $account
* Run access checks for this account.
*
* @return \Drupal\system\MenuInterface[]
* An array of menu objects keyed by menu name.
*/
public function loadUserGroupMenusByGroup($op, $group_id, AccountInterface $account = NULL);
/**
* Get all group menu objects.
*
* We create a static cache of group menus since loading them individually
* has a big impact on performance.
*
* @return \Drupal\system\MenuInterface[][]
* A nested array containing all group menu objects keyed by group ID.
*/
public function getGroupMenus();
}
