source/Application/Model/User.php
public function removeFromGroup($sGroupID = null)
    {
        if ($sGroupID != null && $this->inGroup($sGroupID)) {
            $oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
            $oGroups->init('oxobject2group');
            $sSelect = 'select * from oxobject2group where oxobject2group.oxobjectid = "' . $this->getId() . '" and oxobject2group.oxgroupsid = "' . $sGroupID . '" ';
            $oGroups->selectString($sSelect);
            foreach ($oGroups as $oRemgroup) {
                if ($oRemgroup->delete()) {
                    unset($this->_oGroups[$oRemgroup->oxobject2group__oxgroupsid->value]);
                }
            }
        }
    }
public function removeFromGroup($sGroupID = null)
    {
        if ($sGroupID != null && $this->inGroup($sGroupID)) {
            $oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
            $oGroups->init('oxobject2group');
            $sSelect = 'select * from oxobject2group where oxobject2group.oxobjectid = "' . $this->getId() . '" and oxobject2group.oxgroupsid = "' . $sGroupID . '" ';
            $oGroups->selectString($sSelect);
            foreach ($oGroups as $oRemgroup) {
                if ($oRemgroup->delete()) {
                    unset($this->_oGroups[$oRemgroup->oxobject2group__oxgroupsid->value]);
                }
            }
        }
    }
public function removeFromGroup ( $ sGroupID = null ) { if ( $ sGroupID != null && $ this -> inGroup ( $ sGroupID ) ) { $ oGroups = oxNew ( \ OxidEsales \ Eshop \ Core \ Model \ ListModel :: class ) ; $ oGroups -> init ( 'oxobject2group' ) ; $ sSelect = 'select * from oxobject2group where oxobject2group.oxobjectid = "' . $ this -> getId ( ) . '" and oxobject2group.oxgroupsid = "' . $ sGroupID . '" ' ; $ oGroups -> selectString ( $ sSelect ) ; foreach ( $ oGroups as $ oRemgroup ) { if ( $ oRemgroup -> delete ( ) ) { unset ( $ this -> _oGroups [ $ oRemgroup -> oxobject2group__oxgroupsid -> value ] ) ; } } } }
Removes user from passed user group.

@param string $sGroupID group id
Removes user from passed user group .