Returns the group id that contains the given $capability

@param string $capability

@throws \InvalidArgumentException an invalid $capability was specified

@return string
176234
public function getGroupIDForCapability($capability)
    {
        if (!isset($capability) || !array_key_exists($capability, $this->groupIDCapabilitiesMap)) {
            throw new \InvalidArgumentException('an invalid capability was specified.');
        }

        return $this->groupIDCapabilitiesMap[$capability];
    }
453448
public function getIdByIso($isoCode) {
		$match = ['DE' => 1, 'AT' => 2, 'CH' => 3];

		$isoCode = strtoupper($isoCode);
		if (array_key_exists($isoCode, $match)) {
			return $match[$isoCode];
		}

		throw new InvalidArgumentException('ISO code not valid: ' . $isoCode);
	}
1071297
public function getGroup(string $groupid)
    {
        $cl = $this->getGroupClass();
        $group = new $cl;
        return $group->obtainByGroupID($groupid);
    }
431722
public function getGroup($code) {
        $groupId = is_numeric($code) ? $code : \CGroup::GetIDByCode($code);

        if (empty($groupId)) {
            return false;
        }

        /* extract SECURITY_POLICY */
        $item = \CGroup::GetByID($groupId)->Fetch();
        if (empty($item)) {
            return false;
        }

        if (!empty($item['SECURITY_POLICY'])) {
            $item['SECURITY_POLICY'] = unserialize($item['SECURITY_POLICY']);
        }

        if ($item['ID'] == 1) {
            $item['STRING_ID'] = 'administrators';
        } elseif ($item['ID'] == 2) {
            $item['STRING_ID'] = 'everyone';
        }

        return $item;

    }
1315887
public function get_capability($cap)
    {
        $cap      = strtoupper($cap);
        $sess_key = "STORAGE_$cap";

        if (!isset($_SESSION[$sess_key])) {
            if (!$this->check_connection()) {
                return false;
            }

            $_SESSION[$sess_key] = $this->conn->getCapability($cap);
        }

        return $_SESSION[$sess_key];
    }
1277521
public function getGroupId($current = true)
    {
        if ($current && $this->_hasVar('current_user_group')) {
            return $this->_getVar('current_user_group');
        }
        return $this->_getVar('user_group');
    }
644268
public function has_capability($capability, $userid = null, $doanything = true) {
        return $this->quizobj->has_capability($capability, $userid, $doanything);
    }
710371
public function require_capability($capability, $userid = null, $doanything = true) {
        return $this->quizobj->require_capability($capability, $userid, $doanything);
    }
1115175
public function getPassword()
    {
        if (!array_key_exists(self::PASSWORD, $this->group)) {
            throw new \Exception('Could not get group password from group id.');
        }
        return $this->group[self::PASSWORD];
    }
892935
public static function isUserHasCapability($idSites, $capability)
    {
        try {
            self::checkUserHasCapability($idSites, $capability);
            return true;
        } catch (Exception $e) {
            return false;
        }
    }
420882
public static function getLevelCode(
        /*# string */ $level
    )/*# : int */ {
        if (is_string($level) &&
            isset(self::$levels[$level])) {
            return self::$levels[$level];
        }

        throw new Exception\InvalidArgumentException(
            Message::get(
                Message::INVALID_LOG_LEVEL,
                (string) $level
            ),
            Message::INVALID_LOG_LEVEL
        );
    }
349068
public function getGroup ($groupID)
    {
        $groups = $this->getAllGroups();
        
        foreach ($groups as $group) {
            if ($group->getID() == $groupID) {
                return $group;
            }
        }
        
        return null;
    }
629487
private boolean isValid(Map<String, Object> capability) {
        return capability != null && capability.containsKey(BUNDLE_NAME);
    }
460311
protected function getAbilityIdsAssociatedWithEveryone(array $abilityIds, $forbidden)
    {
        $query = Models::query('permissions')
            ->whereNull('entity_id')
            ->whereIn('ability_id', $abilityIds)
            ->where('forbidden', '=', $forbidden);

        Models::scope()->applyToRelationQuery($query, $query->from);

        return Arr::pluck($query->get(['ability_id']), 'ability_id');
    }
438122
public function add($capability, $params = null)
    {
        $capability = Horde_String::upper($capability);

        if (is_null($params)) {
            if (isset($this->_data[$capability])) {
                return;
            }
            $params = true;
        } else {
            if (!is_array($params)) {
                $params = array($params);
            }
            $params = array_map('Horde_String::upper', $params);

            if (isset($this->_data[$capability]) &&
                is_array($this->_data[$capability])) {
                $params = array_merge($this->_data[$capability], $params);
            }
        }

        $this->_data[$capability] = $params;
        $this->notify();
    }
682067
public function get($identifier)
    {
        if(!isset($this->managers[$identifier]))
            throw new InvalidArgumentException('A manager with that identifier does not exist.');

        return $this->managers[$identifier];
    }
1354106
function get_group($group_id)
    {
        $sql_result = $this->db->query(
            "SELECT * FROM " . $this->db->table_name($this->db_groups, true)
            . " WHERE `del` <> 1 AND `contactgroup_id` = ? AND `user_id` = ?",
            $group_id, $this->user_id);

        if ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) {
            $sql_arr['ID'] = $sql_arr['contactgroup_id'];
            return $sql_arr;
        }

        return null;
    }