Get a list of the user groups.

@return  array
183912
protected function getUserGroups()
	{
		// Initialise variables.
		$db = App::get('db');
		$query = $db->getQuery()
			->select('a.id', 'value')
			->select('a.title', 'text')
			->select('COUNT(DISTINCT b.id)', 'level')
			->select('a.parent_id')
			->from('#__usergroups', 'a')
			->joinRaw('#__usergroups AS b', 'a.lft > b.lft AND a.rgt < b.rgt', 'left')
			->group('a.id')
			->group('a.title')
			->group('a.lft')
			->group('a.rgt')
			->group('a.parent_id')
			->order('a.lft', 'ASC');
		$db->setQuery($query->toString());
		$options = $db->loadObjectList();

		return $options;
	}
1288285
public function getUserGroups($lang = "")
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Permissions', 'read')) {
            return $this->noPermission();
        }
        return array('data' => \App\Models\UserGroup::all());
    }
809880
protected function getResponseGroups()
    {
        $resGroups = $this->request->variables['ResponseGroups'];
        for ( $i = 0, $iMax = count( $this->defaultResponsegroups ); $i < $iMax; ++$i )
        {
            if ( !in_array( $this->defaultResponsegroups[$i], $resGroups ) )
                $resGroups[] = $this->defaultResponsegroups[$i];
        }

        return $resGroups;
    }
986589
public function getGroups()
    {
        $request = new Request\GetGroupsRequest($this->getCredential());
        $response = $this->sendRequest($request);

        return Request\GetGroupsRequest::parseResponse($response);
    }
430520
public function getGroups()
    {
        if ($this->_oGroups == null && ($sOxid = $this->getId())) {
            // user groups
            $this->_oGroups = oxNew('oxlist', 'oxgroups');
            $sViewName = getViewName("oxgroups", $this->getLanguage());

            // performance
            $sSelect = "select {$sViewName}.* from {$sViewName}, oxobject2group
                        where oxobject2group.oxobjectid = '{$sOxid}'
                        and oxobject2group.oxgroupsid={$sViewName}.oxid ";
            $this->_oGroups->selectString($sSelect);
        }

        return $this->_oGroups;
    }
277056
public function getUserGroups() {

        $db = $this->db;

        $query = $db->getQuery(true)
                    ->select('a.*, COUNT(DISTINCT b.id) AS level')
                    ->from($db->quoteName('#__usergroups') . ' AS a')
                    ->join('LEFT', $db->quoteName('#__usergroups') . ' AS b ON a.lft > b.lft AND a.rgt < b.rgt')
                    ->group('a.id, a.title, a.lft, a.rgt, a.parent_id')
                    ->order('a.lft ASC');

        return $db->setQuery($query)
                  ->loadObjectList();

    }
71752
def _get_groups(self):
        
        if self._groups is None:
            self._groups = _LDAPUserGroups(self)

        return self._groups
1088496
public function get_usergroups( $force = false ) {
		if( $force ) {

			$uiRes = $this->wiki->apiQuery(
				array(
					'action'  => 'query',
					'list'    => 'users',
					'ususers' => $this->username,
					'usprop'  => 'groups'
				)
			);

			$this->groups = $uiRes['query']['users'][0]['groups'];
		}
		return $this->groups;
	}
574746
public function getGroupNames()
    {
        if (empty($this->groups)) {
            return [];
        }

        $result = [];
        foreach ($this->groups as $group) {
            $result[] = $group->name;
        }

        return $result;
    }
316093
public function getGroups()
	{
		if (!is_array($this->_xml))
		{

			return false;
		}

		$results = array();
		foreach ($this->_xml as $name => $group)
		{
			$results[$name] = $this->getNumParams($name);
		}

		return $results;
	}
259044
public function getGroups()
    {
        $result = [];

        $this->addHeader();
        try {
            $rawGroups = $this->getSoap()->GetAcsEmployeeGroups()->GetAcsEmployeeGroupsResult;
            if (isset($rawGroups->AcsEmployeeGroup) && is_array($rawGroups->AcsEmployeeGroup)) {
                $rawGroups = $rawGroups->AcsEmployeeGroup;
            }
            foreach ($rawGroups as $group) {
                $result[] = new EmployeeGroup((array)$group);
            }
        } catch (\SoapFault $ex) {
            $this->logError();
        }

        return $result;
    }
475813
public static function groupNames()
    {
        $groups = [];

        foreach(static::groups() as $groupname => $group) {
            $groups[$groupname] = $group['readableName'] ?? $groupname;
        }

        return $groups;
    }
348338
def get_groups(user=None):
    
    portal_groups = get_tool("portal_groups")
    user = get_user(user)
    if user is None:
        return []
    return portal_groups.getGroupsForPrincipal(user)
502625
public function getUserFlags() : array
    {
        if ($this->flags !== null) {
            return $this->flags;
        }

        $this->flags = [];
        $usergroups = $this->usergroups;

        foreach ($usergroups as $usergroup) {
            $group = $usergroup->group;
            $flags = $group->flags;

            if (!empty($flags)) {
                $this->flags = array_merge($this->flags, $flags);
            }
        }

        return $this->flags;
    }
237518
public function getGroupList()
    {
        $result = $this->httpGet(self::WECHAT_GROUP_LIST_GET_PREFIX, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['groups']) ? $result['groups'] : false;
    }
549655
public function list_wlan_groups()
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $response = $this->exec_curl('/api/s/' . $this->site . '/list/wlangroup');

        return $this->process_response($response);
    }
29158
public function getGroups()
	{
		if ( ! $this->userGroups)
		{
			$this->userGroups = $this->groups()->get();
		}

		return $this->userGroups;
	}