Returns assigned user groups list object

@return object $_oGroups
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;
    }
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;
    }
944594
def _get_user_groups(self, user):
        '''
        
        '''
        return [g.gr_name for g in grp.getgrall()
                if user in g.gr_mem] + [grp.getgrgid(pwd.getpwnam(user).pw_gid).gr_name]
29158
public function getGroups()
	{
		if ( ! $this->userGroups)
		{
			$this->userGroups = $this->groups()->get();
		}

		return $this->userGroups;
	}
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;
    }
1063211
public function getAssignedMembers()
    {
        $members = ArrayList::create($this->Users()->toArray());
        $groups  = $this->Groups();

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

        $members->removeDuplicates();
        return $members;
    }
1307486
public static function map_in_groups($groups = null)
    {
        $groupIDList = array();

        if ($groups instanceof SS_List) {
            foreach ($groups as $group) {
                $groupIDList[] = $group->ID;
            }
        } elseif (is_array($groups)) {
            $groupIDList = $groups;
        } elseif ($groups) {
            $groupIDList[] = $groups;
        }

        // No groups, return all Members
        if (!$groupIDList) {
            return static::get()->sort(array('Surname' => 'ASC', 'FirstName' => 'ASC'))->map();
        }

        $membersList = new ArrayList();
        // This is a bit ineffective, but follow the ORM style
        /** @var Group $group */
        foreach (Group::get()->byIDs($groupIDList) as $group) {
            $membersList->merge($group->Members());
        }

        $membersList->removeDuplicates('ID');

        return $membersList->map();
    }
237518
public function getGroupList()
    {
        $result = $this->httpGet(self::WECHAT_GROUP_LIST_GET_PREFIX, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['groups']) ? $result['groups'] : false;
    }
1166829
public function groups()
    {
        if ($this->groups === null) {
            $ident    = $this->ident();
            $metadata = $this->adminSecondaryMenu();

            $this->groups = [];
            if (isset($metadata[$ident]['groups'])) {
                $groups = $metadata[$ident]['groups'];

                if (is_array($groups)) {
                    $this->setGroups($groups);
                }
            }
        }

        return $this->groups;
    }
250304
public function listAction()
    {
        $groupManager = $this->get('phlexible_user.group_manager');

        $groups = [];
        foreach ($groupManager->findAll() as $group) {
            $members = [];
            foreach ($group->getUsers() as $user) {
                $members[] = $user->getDisplayName();
            }
            sort($members);

            $groups[] = [
                'gid' => $group->getId(),
                'name' => $group->getName(),
                'readonly' => false,
                'memberCnt' => count($members),
                'members' => $members,
            ];
        }

        return new JsonResponse($groups);
    }
1126527
protected function getListCategoryGroup()
    {
        $conditions = $this->query_filter;
        $conditions['limit'] = $this->data_limit;

        return $this->category_group->getList($conditions);
    }
247930
public function getGroups()
    {
        $groups = [];

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

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

        return $groups;
    }
682001
function groups( $asObject = false )
    {
        if ( $asObject == true )
        {
            if ( !isset( $this->GroupsAsObjects ) )
            {
                $this->GroupsAsObjects = array();

                foreach ( $this->groups() as $group )
                {
                    $this->GroupsAsObjects[] = new eZContentObject( $group );
                }
            }

            return $this->GroupsAsObjects;
        }
        else
        {
            if ( !isset( $this->Groups ) )
            {
                $this->fetchUserCacheIfNeeded();
                if ( !isset($this->UserCache['groups']) )
                {
                    $this->UserCache['groups'] = $this->generateGroupIdList();
                }

                $this->Groups = $this->UserCache['groups'];
            }

            return $this->Groups;
        }
    }
1183480
protected function getFrontendGroups()
    {
        $frontendGroupsList = implode(',', $this->frontendGroups);
        $frontendGroups = GeneralUtility::trimExplode(',', $frontendGroupsList,
            true);

        // clean up: filter double groups
        $frontendGroups = array_unique($frontendGroups);
        $frontendGroups = array_values($frontendGroups);

        if (empty($frontendGroups)) {
            // most likely an empty page with no content elements => public
            $frontendGroups[] = '0';
        }

        return $frontendGroups;
    }
649487
public function get_numusers($groups = true, $users = false) {
        global $CFG, $DB;
        $userwheresql = "";
        $groupsql      = "";
        $groupwheresql = "";

        // Limit to users with a gradeable role.
        list($gradebookrolessql, $gradebookrolesparams) = $DB->get_in_or_equal(explode(',', $this->gradebookroles), SQL_PARAMS_NAMED, 'grbr0');

        // Limit to users with an active enrollment.
        list($enrolledsql, $enrolledparams) = get_enrolled_sql($this->context);

        // We want to query both the current context and parent contexts.
        list($relatedctxsql, $relatedctxparams) = $DB->get_in_or_equal($this->context->get_parent_context_ids(true), SQL_PARAMS_NAMED, 'relatedctx');

        $params = array_merge($gradebookrolesparams, $enrolledparams, $relatedctxparams);

        if ($users) {
            $userwheresql = $this->userwheresql;
            $params       = array_merge($params, $this->userwheresql_params);
        }

        if ($groups) {
            $groupsql      = $this->groupsql;
            $groupwheresql = $this->groupwheresql;
            $params        = array_merge($params, $this->groupwheresql_params);
        }

        $sql = "SELECT DISTINCT u.id
                       FROM {user} u
                       JOIN ($enrolledsql) je
                            ON je.id = u.id
                       JOIN {role_assignments} ra
                            ON u.id = ra.userid
                       $groupsql
                      WHERE ra.roleid $gradebookrolessql
                            AND u.deleted = 0
                            $userwheresql
                            $groupwheresql
                            AND ra.contextid $relatedctxsql";
        $selectedusers = $DB->get_records_sql($sql, $params);

        $count = 0;
        // Check if user's enrolment is active and should be displayed.
        if (!empty($selectedusers)) {
            $coursecontext = $this->context->get_course_context(true);

            $defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
            $showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradeshowactiveenrol);
            $showonlyactiveenrol = $showonlyactiveenrol || !has_capability('moodle/course:viewsuspendedusers', $coursecontext);

            if ($showonlyactiveenrol) {
                $useractiveenrolments = get_enrolled_users($coursecontext, '', 0, 'u.id',  null, 0, 0, true);
            }

            foreach ($selectedusers as $id => $value) {
                if (!$showonlyactiveenrol || ($showonlyactiveenrol && array_key_exists($id, $useractiveenrolments))) {
                    $count++;
                }
            }
        }
        return $count;
    }
274409
public function getUserGroups()
    {
        $groups = [];
        foreach ($this->adminGroupConfiguration->getGroups() as $groupName) {
            $groups[] = $this->getUserGroup("$groupName");
        }
        $groups[] = $this->getUserGroup('guest');

        return $groups;
    }
419102
public function getGroupsAccounts()
  {
    //Is Group: Further accounts can be made under Groups, but entries can be made against non-Groups
    $accounts = array();

    $this->Account->byOrganization($this->AuthenticationManager->getCurrentUserOrganizationId())->each(function($Account) use (&$accounts)
    {
      if($Account->is_group)
      {
        array_push($accounts, array('label'=> $Account->key . ' ' . $Account->name, 'value'=>$Account->id));
      }
    });

    return $accounts;
  }