Returns assigned user groups list object

@param string $sOXID object ID (default is null)

@return object
504591
public function getUserGroups($sOXID = null)
    {

        if (isset($this->_oGroups)) {
            return $this->_oGroups;
        }

        if (!$sOXID) {
            $sOXID = $this->getId();
        }

        $sViewName = getViewName("oxgroups");
        $this->_oGroups = oxNew('oxList', 'oxgroups');
        $sSelect = "select {$sViewName}.* from {$sViewName} left join oxobject2group on oxobject2group.oxgroupsid = {$sViewName}.oxid
                     where oxobject2group.oxobjectid = " . \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quote($sOXID);
        $this->_oGroups->selectString($sSelect);

        return $this->_oGroups;
    }
586568
public function delete($sOxId = null)
    {
        if (!$sOxId) {
            $sOxId = $this->getId();
        }
        if (!$sOxId) {
            return false;
        }

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $sOxIdQuoted = $oDb->quote($sOxId);
        $oDb->execute('delete from oxobject2payment where oxobjectid = ' . $sOxIdQuoted);
        $oDb->execute('delete from oxobject2delivery where oxdeliveryid = ' . $sOxIdQuoted);
        $oDb->execute('delete from oxdel2delset where oxdelsetid = ' . $sOxIdQuoted);

        return parent::delete($sOxId);
    }
1343278
public function getUserGroups($oxId = null)
    {
        if (!$this->isCallBackUserPayPalUser()) {
            return parent::getUserGroups();
        }

        if (!$this->_oGroups) {
            /** @var \OxidEsales\Eshop\Core\TableViewNameGenerator $viewNameGenerator */
            $viewNameGenerator = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Core\TableViewNameGenerator::class);
            $viewName = $viewNameGenerator->getViewName("oxgroups");
            $select = "select {$viewName}.* from {$viewName} where ({$viewName}.oxid = 'oxidnotyetordered' OR {$viewName}.oxid = 'oxidnewcustomer')";
            $this->_oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class, \OxidEsales\Eshop\Application\Model\Groups::class);
            $this->_oGroups->selectString($select);
        }

        return $this->_oGroups;
    }
735205
public function getMyPermissions($orgId)
    {
        $response = $this->doRequest(
            self::RESOURCE_GET_MY_PERMISSIONS,
            [
                'orgId' => $orgId
            ]
        );

        return OrganizationUserPermissions::fromStream($response);
    }
124603
public function admin_authorised_user_list($users, $serviceid) {
        global $CFG;
        $html = $this->output->box_start('generalbox', 'alloweduserlist');
        foreach ($users as $user) {
            $modifiedauthoriseduserurl = new moodle_url('/' . $CFG->admin . '/webservice/service_user_settings.php',
                            array('userid' => $user->id, 'serviceid' => $serviceid));
            $html .= html_writer::tag('a', $user->firstname . " "
                            . $user->lastname . ", " . $user->email,
                            array('href' => $modifiedauthoriseduserurl));
            //add missing capabilities
            if (!empty($user->missingcapabilities)) {
                $html .= html_writer::tag('div',
                                get_string('usermissingcaps', 'webservice', $user->missingcapabilities)
                                . '&nbsp;' . $this->output->help_icon('missingcaps', 'webservice'),
                                array('class' => 'missingcaps', 'id' => 'usermissingcaps'));
                $html .= html_writer::empty_tag('br');
            } else {
                $html .= html_writer::empty_tag('br') . html_writer::empty_tag('br');
            }
        }
        $html .= $this->output->box_end();
        return $html;
    }
498426
public function getOrganizationUsers($orgId)
    {
        $response = $this->doRequest(
            self::RESOURCE_GET_ORGANIZATION_USERS,
            [
                'orgId' => $orgId
            ]
        );

        return OrganizationUsersList::fromStream($response);
    }
395869
public function listAction($userId)
    {
        $userManager = $this->get('phlexible_user.user_manager');
        $systemUid = $userManager->getSystemUserId();

        $skipUserIds = [$userId];
        if (!in_array($systemUid, $skipUserIds)) {
            $skipUserIds[] = $systemUid;
        }

        $users = [];
        foreach ($userManager->findAll() as $user) {
            if (in_array($user->getId(), $skipUserIds)) {
                continue;
            }

            $users[$user->getDisplayName()] = [
                'uid' => $user->getId(),
                'name' => $user->getDisplayName(),
            ];
        }

        ksort($users);
        $users = array_values($users);

        return new JsonResponse($users);
    }
1011478
public function findUserGroups()
    {
        if ( null === $this->userGroups )
        {
            $this->userGroups = array();

            $select = $this->sql( 'user_group' )
                           ->select()
                           ->columns( array( 'id', 'name' ) );

            /* @var $result \Zend\Db\Adapter\Driver\ResultInterface */
            $result = $this->sql()
                           ->prepareStatementForSqlObject( $select )
                           ->execute();

            foreach ( $result as $row )
            {
                $this->userGroups[$row['id']] = $row['name'];
            }
        }

        return $this->userGroups;
    }
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();
    }
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;
	}
359993
public function getGroup($groupId)
    {
        static $groups = array();

        if (! isset($groups[$groupId])) {
            $groups[$groupId] = $this->_loadClass('Group', true, array($groupId));
    }

        return $groups[$groupId];
    }
405557
public function inGroup($sGroupID)
    {
        $blResult = false;
        $aGroups = $this->getGroups();
        foreach ($aGroups as $oObject) {
            if ($oObject->_sOXID == $sGroupID) {
                $blResult = true;
                break;
            }
        }

        return $blResult;
    }
654790
protected function _getLanguageInfo($sOxId)
    {
        $sDefaultLang = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('sDefaultLang');

        $aLangData = $this->_aLangData['params'][$sOxId];
        $aLangData['abbr'] = $sOxId;
        $aLangData['desc'] = $this->_aLangData['lang'][$sOxId];
        $aLangData['baseurl'] = $this->_aLangData['urls'][$aLangData['baseId']];
        $aLangData['basesslurl'] = $this->_aLangData['sslUrls'][$aLangData['baseId']];
        $aLangData['default'] = ($this->_aLangData['params'][$sOxId]["baseId"] == $sDefaultLang) ? true : false;

        return $aLangData;
    }
528901
public function getGroups( $uid ) {
        static $groups = [];
        if ( isset($groups[$uid]) )
            return $groups[$uid];
        $user_groups = Db::table( $this->prefix.$this->_config['auth_group_access'] )
            ->alias('a')
            ->join( $this->prefix.$this->_config['auth_group']." g", "g.id=a.group_id" )
            ->where( "a.uid='$uid' and g.status='1'" )
            ->field( 'uid,group_id,title,rules' )->select();
        $groups[$uid] = $user_groups ? $user_groups : [];
        return $groups[$uid];
    }
503904
protected function _checkMultilangFieldsExistsInDb($sOxId)
    {
        $iBaseId = $this->_aLangData['params'][$sOxId]['baseId'];
        $sTable = getLangTableName('oxarticles', $iBaseId);
        $sColumn = 'oxtitle' . \OxidEsales\Eshop\Core\Registry::getLang()->getLanguageTag($iBaseId);

        $oDbMetadata = oxNew(\OxidEsales\Eshop\Core\DbMetaDataHandler::class);

        return $oDbMetadata->tableExists($sTable) && $oDbMetadata->fieldExists($sColumn, $sTable);
    }
115139
public function getGroupUsers($groupId, $options=array()){

        $data = array();
        
        $data['group_id'] = $groupId;

        $data = array_merge($data, $options);

        return $this->request($this->groupGetusersUrl, $data);
    }
842043
public function retrieveGroupOwners($groupId)
    {
        $uri  = self::APPS_BASE_FEED_URI . self::APPS_GROUP_PATH . '/';
        $uri .= $this->getDomain() . '/' . $groupId . '/owner';

        return $this->getOwnerFeed($uri);
    }