Gets the groups this user is a member of.

@return array groups
335866
public function groups()
    {
        $return = ['everyone'];

        $groups = GroupMember::where('user_id', $this->id())
            ->sort('`group` ASC')
            ->all();

        foreach ($groups as $group) {
            $return[] = $group->group;
        }

        return $return;
    }
959106
public function getAssignedMembers()
    {
        $list   = new ArrayList();
        $groups = $this->Groups();

        $list->merge($this->Users());

        foreach ($groups as $group) {
            $list->merge($group->Members());
        }

        $list->removeDuplicates();
        return $list;
    }
100050
public function getGroup()
    {
        if ( null === $this->group && $this->groupId )
        {
            $this->group = $this->getMapper()
                                ->getUserGroupMapper()
                                ->find( $this->groupId );
        }

        return $this->group;
    }
202210
public function getGroupIds()
    {
        $groups = $this->groups;

        $groupIds = array();
        if (count($groups) > 0) {
            /* @var $group GroupInterface */
            foreach ($groups as $group) {
                $groupIds[] = $group->getId();
            }
        }

        return $groupIds;
    }
488213
public function groups()
    {
        $result = [];
        foreach ($this->_config['groups'] as $group) {
            $value = xcache_get($this->_config['prefix'] . $group);
            if (!$value) {
                $value = 1;
                xcache_set($this->_config['prefix'] . $group, $value, 0);
            }
            $result[] = $group . $value;
        }

        return $result;
    }
643267
public function getAuthorisedGroups()
	{
		if (is_null($this->authGroups))
		{
			$this->authGroups = array();
		}

		if (empty($this->authGroups))
		{
			$this->authGroups = Access::getGroupsByUser($this->get('id'));
		}

		return $this->authGroups;
	}
329664
public function getGroups()
    {
        if (isset($this->_oGroups)) {
            return $this->_oGroups;
        }

        // usergroups
        $this->_oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class, "oxgroups");
        $sViewName = getViewName("oxgroups");

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

        return $this->_oGroups;
    }
1026984
protected function getGroups()
	{
		$groups = array();

		// Get the list of time zones from the server.
		$zones = \DateTimeZone::listIdentifiers();

		// Build the group lists.
		foreach ($zones as $zone)
		{
			// Time zones not in a group we will ignore.
			if (strpos($zone, '/') === false)
			{
				continue;
			}

			// Get the group/locale from the timezone.
			list ($group, $locale) = explode('/', $zone, 2);

			// Only use known groups.
			if (in_array($group, self::$zones))
			{
				// Initialize the group if necessary.
				if (!isset($groups[$group]))
				{
					$groups[$group] = array();
				}

				// Only add options where a locale exists.
				if (!empty($locale))
				{
					$groups[$group][$zone] = Select::option($zone, str_replace('_', ' ', $locale), 'value', 'text', false);
				}
			}
		}

		// Sort the group lists.
		ksort($groups);

		foreach ($groups as &$location)
		{
			sort($location);
		}

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

		return $groups;
	}
737558
public function findUsersWithNoGroup()
    {
        $query = $this->find();

        return $query->leftJoin(
                [$this->UsersGroups->alias() => $this->UsersGroups->table()],
                [$this->aliasField('id') . ' = ' . $this->UsersGroups->aliasField('user_id')]
            )
            ->select([
                'Users.id',
                'group_count' => $query->func()->count('UsersGroups.group_id')
            ])
            ->group('Users.id')
            ->having('group_count = 0');
    }
215243
public function getAuthUserGroup()
    {
        $user_groups = Auth::user()->find(Auth::user()->id)->group;

        // create an array
        $usergroupArray = [];
        foreach ($user_groups as $user_group) {
            $usergroupArray[] = $user_group->title;
        }

        return $usergroupArray;
    }
509914
public function getRemoteGroups(): array
    {
        $result = [];

        if (!(bool)Configure::read('Groups.remoteGroups.enabled')) {
            return $result;
        }

        if ((bool)Configure::read('Groups.remoteGroups.LDAP.enabled')) {
            $result = $this->_getLdapGroups();
        }

        return $result;
    }
64783
public function get_groups() {
		$groups = array(
			array(
				'id'   => 'actions',
				'name' => __( 'Actions', 'icon-picker' ),
			),
			array(
				'id'   => 'currency',
				'name' => __( 'Currency', 'icon-picker' ),
			),
			array(
				'id'   => 'media',
				'name' => __( 'Media', 'icon-picker' ),
			),
			array(
				'id'   => 'misc',
				'name' => __( 'Misc.', 'icon-picker' ),
			),
			array(
				'id'   => 'places',
				'name' => __( 'Places', 'icon-picker' ),
			),
			array(
				'id'   => 'social',
				'name' => __( 'Social', 'icon-picker' ),
			),
		);

		/**
		 * Filter genericon groups
		 *
		 * @since 0.1.0
		 * @param array $groups Icon groups.
		 */
		$groups = apply_filters( 'icon_picker_genericon_groups', $groups );

		return $groups;
	}
1363893
public function groups()
    {
        if (empty($this->_compiledGroupNames)) {
            foreach ($this->_config['groups'] as $group) {
                $this->_compiledGroupNames[] = $this->_config['prefix'] . $group;
            }
        }

        $groups = $this->_Memcached->getMulti($this->_compiledGroupNames) ?: [];
        if (count($groups) !== count($this->_config['groups'])) {
            foreach ($this->_compiledGroupNames as $group) {
                if (!isset($groups[$group])) {
                    $this->_Memcached->set($group, 1, 0);
                    $groups[$group] = 1;
                }
            }
            ksort($groups);
        }

        $result = [];
        $groups = array_values($groups);
        foreach ($this->_config['groups'] as $i => $group) {
            $result[] = $group . $groups[$i];
        }

        return $result;
    }
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;
    }
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();

    }
1318042
public function getGroups()
    {
        $groups = array();
        foreach ($this->graph->getVertices() as $vertex) {
            $groups[$vertex->getGroup()] = true;
        }

        return array_keys($groups);
    }
1146011
public function groups()
    {
        if (empty($this->_compiledGroupNames)) {
            foreach ($this->_config['groups'] as $group) {
                $this->_compiledGroupNames[] = $this->_config['prefix'] . $group;
            }
        }

        $groups = wincache_ucache_get($this->_compiledGroupNames);
        if (count($groups) !== count($this->_config['groups'])) {
            foreach ($this->_compiledGroupNames as $group) {
                if (!isset($groups[$group])) {
                    wincache_ucache_set($group, 1);
                    $groups[$group] = 1;
                }
            }
            ksort($groups);
        }

        $result = [];
        $groups = array_values($groups);
        foreach ($this->_config['groups'] as $i => $group) {
            $result[] = $group . $groups[$i];
        }

        return $result;
    }