CBlogUser :: DeleteFromUserGroup: Bitrix method

      
<?php 
//  CBlogUser :: DeleteFromUserGroup()
//  /dist/bitrix/modules/blog/general/blog_user.php:189

    
public static function DeleteFromUserGroup($ID$blogID$selectType BLOG_BY_BLOG_USER_ID)
    {
        global 
$DB;

        
$ID IntVal($ID);
        
$blogID IntVal($blogID);
        
$selectType = (($selectType == BLOG_BY_USER_ID) ? BLOG_BY_USER_ID BLOG_BY_BLOG_USER_ID);

        
$bSuccess True;

        
$arResult CBlog::GetByID($blogID);
        if (!
$arResult)
        {
            
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#"$blogIDGetMessage("BLG_GU_ERROR_NO_BLOG")), "ERROR_NO_BLOG");
            
$bSuccess False;
        }

        if (
$bSuccess)
        {
            
$arUser CBlogUser::GetByID($ID$selectType);

            
$dbResult CUser::GetByID($arUser["USER_ID"]);
            if (!
$dbResult->Fetch())
            {
                
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("BLG_GU_ERROR_NO_USER_ID"), "ERROR_NO_USER_ID");
                
$bSuccess False;
            }
        }

        if (
$bSuccess)
        {
            
$DB->Query(
                
"DELETE FROM b_blog_user2user_group ".
                
"WHERE USER_ID = ".IntVal($arUser["USER_ID"])." ".
                
"    AND BLOG_ID = ".$blogID." "
            
);
        }

        return 
$bSuccess;
    }