You are here

protected function AckMenuMap::mappedRealm in Access Control Kit 7

Finds the mapped realm for a menu link.

Parameters

int $mlid: A menu link ID.

Return value

int|null The link's assigned realm value, or NULL if no mapping found.

2 calls to AckMenuMap::mappedRealm()
AckMenuMap::objectFormAlter in ack_menu/handlers/ack_menu_map.inc
Overrides AccessControlKitHandler::objectFormAlter().
AckMenuMap::objectRealms in ack_menu/handlers/ack_menu_map.inc
Overrides AccessControlKitHandler::objectRealms().

File

ack_menu/handlers/ack_menu_map.inc, line 63
Contains the handler class for mapping menu links to access realms.

Class

AckMenuMap
Controls access to menu links based on realm mapping.

Code

protected function mappedRealm($mlid) {
  $realm = db_query('SELECT realm FROM {ack_menu_map} WHERE scheme = :scheme AND mlid = :mlid', array(
    ':scheme' => $this->schemeMachineName,
    ':mlid' => $mlid,
  ))
    ->fetchField();
  return empty($realm) ? NULL : $realm;
}