Returns the list of website groups, including the empty group
if no group were specified for some websites

@return array of group names strings
504434
public function getSitesGroups()
    {
        $db = $this->getDb();
        $groups = $db->fetchAll("SELECT DISTINCT `group` FROM " . $this->table);

        $cleanedGroups = array();
        foreach ($groups as $group) {
            $cleanedGroups[] = $group['group'];
        }

        return $cleanedGroups;
    }
26934
private function Groups()
    {
        if ($this->groups === null)
        {
            $this->groups = array();
            if ($this->GetMember())
            {
                $this->groups = MembergroupUtil::MemberMembergroups($this->GetMember());
            }
        }
        return $this->groups;
    }
1198214
public static function getAllGroupClientIdList()
    {
        $data = static::select(array('groups'));
        $group_client_id_map = array();
        foreach ($data as $local_ip => $buffer_array) {
            foreach ($buffer_array as $local_port => $items) {
                //$items = ['connection_id'=>['uid'=>x, 'group'=>[x,x..], 'session'=>[..]], 'client_id'=>[..], ..];
                foreach ($items as $connection_id => $info) {
                    if (empty($info['groups'])) {
                        break;
                    }
                    $client_id = Context::addressToClientId($local_ip, $local_port, $connection_id);
                    foreach ($info['groups'] as $group_id) {
                        if(!isset($group_client_id_map[$group_id])) {
                            $group_client_id_map[$group_id] = array();
                        }
                        $group_client_id_map[$group_id][$client_id] = $client_id;
                    }
                }
            }
        }
        return $group_client_id_map;
    }
1027452
public String[] getGroupArrayNames() {
        synchronized (groupNames) {
            return Collections.unmodifiableList(groupNames).toArray(new String[groupNames.size()]);
        }
    }
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);
    }
341821
public function getGroupList()
    {
        $result = $this->wechat->httpGet(self::WECHAT_GROUP_LIST_PREFIX, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['groups_detail'] : false;
    }
247930
public function getGroups()
    {
        $groups = [];

        foreach ($this->rootlineElements as $rootlineElement) {
            $rootlineElementGroups = $rootlineElement->getGroups();
            $groups = array_merge($groups, $rootlineElementGroups);
        }

        $groups = $this->cleanGroupArray($groups);

        return $groups;
    }
285513
protected function getGroups()
	{
		$groups = array();
		$label = 0;

		$select = new HtmlSelect;

		// Try to inject the text object into the field
		try
		{
			$select->setText($this->getText());
		}
		catch (\RuntimeException $exception)
		{
			// A Text object was not set, ignore the error and try to continue processing
		}

		/** @var \SimpleXMLElement $element */
		foreach ($this->element->children() as $element)
		{
			switch ($element->getName())
			{
				// The element is an <option />
				case 'option':
					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Create a new option object based on the <option /> element.
					$tmp = $select->option(
						($element['value']) ? (string) $element['value'] : trim((string) $element),
						$this->getText()->alt(trim((string) $element), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text',
						((string) $element['disabled'] == 'true')
					);

					// Set some option attributes.
					$tmp->class = (string) $element['class'];

					// Set some JavaScript option attributes.
					$tmp->onclick = (string) $element['onclick'];

					// Add the option.
					$groups[$label][] = $tmp;
					break;

				// The element is a <group />
				case 'group':
					// Get the group label.
					if ($groupLabel = (string) $element['label'])
					{
						$label = $this->translateLabel ? $this->getText()->translate($groupLabel) : $groupLabel;
					}

					// Initialize the group if necessary.
					if (!isset($groups[$label]))
					{
						$groups[$label] = array();
					}

					// Iterate through the children and build an array of options.
					/** @var \SimpleXMLElement $option */
					foreach ($element->children() as $option)
					{
						// Only add <option /> elements.
						if ($option->getName() != 'option')
						{
							continue;
						}

						// Create a new option object based on the <option /> element.
						$tmp = $select->option(
							($option['value']) ? (string) $option['value'] : $this->getText()->translate(trim((string) $option)),
							$this->getText()->translate(trim((string) $option)), 'value', 'text', ((string) $option['disabled'] == 'true')
						);

						// Set some option attributes.
						$tmp->class = (string) $option['class'];

						// Set some JavaScript option attributes.
						$tmp->onclick = (string) $option['onclick'];

						// Add the option.
						$groups[$label][] = $tmp;
					}

					if ($groupLabel)
					{
						$label = count($groups);
					}
					break;

				// Unknown element type.
				default:
					throw new \UnexpectedValueException(
						sprintf('Unsupported element %1$s in %2$s', $element->getName(), __CLASS__),
						500
					);
			}
		}

		reset($groups);

		return $groups;
	}
1310053
public function getGroupsPairs()
    {
        // Check or init cache
        if (!self::$cached_group_pairs) {
            $user_collection = new AdminUserGroupRepository;
            $user_collection->addOrderByField('title');
            $pairs = $user_collection->getPairs('title');

            self::$cached_group_pairs = $pairs;
        }

        return self::$cached_group_pairs;
    }
1255275
protected function askForGroups()
    {
        $default = 0;
        $groups = $this->groups();
        $group_names = collect($groups)->pluck('name')->toArray();
        $selected_group_names =  $this->choice('Groups?', $group_names ,$default, null, true);

        $groups = collect($groups)->filter(function ($group) use ($selected_group_names) {
            return in_array($group->name,$selected_group_names);
        });

        return $groups->pluck('id');
    }
1033047
public function getGroupedApplications()
    {
        $organizations = $this->getEntityManager()
            ->getRepository(Organization::class)
            ->findAll();

        $applications = $this->findAll();

        usort($applications, $this->applicationSorter());
        usort($organizations, $this->organizationSorter());

        $grouped = [];
        foreach ($organizations as $org) {
            $grouped[$org->id()] = [];
        }

        foreach ($applications as $app) {
            $orgID = $app->organization() ? $app->organization()->id() : 'none';
            $grouped[$orgID][] = $app;
        }

        return $grouped;
    }
1088463
private function get_groups_all() {
        if (is_null($this->groups)) {
            // NOTE: Performance could be improved here. The system caches user groups
            // in $USER->groupmember[$courseid] => array of groupid=>groupid. Unfortunately this
            // structure does not include grouping information. It probably could be changed to
            // do so, without a significant performance hit on login, thus saving this one query
            // each request.
            $this->groups = groups_get_user_groups($this->course->id, $this->userid);
        }
        return $this->groups;
    }
498794
public List<Group> getTopGroups() {
        if (root != null && root.getGroups() != null && root.getGroups().size() == 1) {
            return root.getGroups().get(0).getGroups();
        }
        return new ArrayList<Group>();
    }
759688
public List<String> groupNames() {
        if (groupNames == null) {
            groupNames = new ArrayList<String>(groupInfo.keySet());
        }
        return Collections.unmodifiableList(groupNames);
    }
1346156
public function getNames()
    {
        $cacheId   = 'SearchEngine.getSearchEngineNames';
        $cache     = Cache::getTransientCache();
        $nameToUrl = $cache->fetch($cacheId);

        if (empty($nameToUrl)) {
            $searchEngines = $this->getDefinitions();

            $nameToUrl = array();
            foreach ($searchEngines as $url => $info) {
                if (!isset($nameToUrl[$info['name']])) {
                    $nameToUrl[$info['name']] = $url;
                }
            }
            $cache->save($cacheId, $nameToUrl);
        }

        return $nameToUrl;
    }
1211420
public function getContentTypeGroups()
    {
        $contentTypeGroups = array();
        foreach ($this->contentTypeGroupReferences as $reference) {
            $contentTypeGroups[] = $this->contentTypeService->loadContentTypeGroup($reference);
        }

        return $contentTypeGroups;
    }
726837
protected function getGroups()
	{
		// Initialize variables.
		$groups = array();

		// Initialize some field attributes.
		$menuType  = (string) $this->element['menu_type'];
		$published = $this->element['published'] ? explode(',', (string) $this->element['published']) : array();
		$disable   = $this->element['disable'] ? explode(',', (string) $this->element['disable']) : array();
		$language  = $this->element['language'] ? explode(',', (string) $this->element['language']) : array();

		// Get the menu items.
		$items = array();
		if (file_exists(PATH_CORE . '/components/com_menus/helpers/menus.php'))
		{
			// Import the com_menus helper.
			require_once PATH_CORE . '/components/com_menus/helpers/menus.php';

			$items = \Components\Menus\Helpers\Menus::getMenuLinks($menuType, 0, 0, $published, $language);
		}

		// Build group for a specific menu type.
		if ($menuType)
		{
			// Initialize the group.
			$groups[$menuType] = array();

			// Build the options array.
			foreach ($items as $link)
			{
				$groups[$menuType][] = Dropdown::option($link->value, $link->text, 'value', 'text', in_array($link->type, $disable));
			}
		}
		// Build groups for all menu types.
		else
		{
			// Build the groups arrays.
			foreach ($items as $menu)
			{
				// Initialize the group.
				$groups[$menu->menutype] = array();

				// Build the options array.
				foreach ($menu->links as $link)
				{
					$groups[$menu->menutype][] = Dropdown::option(
						$link->value, $link->text, 'value', 'text',
						in_array($link->type, $disable)
					);
				}
			}
		}

		// Merge any additional groups in the XML definition.
		$groups = array_merge(parent::getGroups(), $groups);

		return $groups;
	}