CBlogUser :: GetByID: Bitrix method

      
<?php 
//  CBlogUser :: GetByID()
//  /dist/bitrix/modules/blog/general/blog_user.php:347

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

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

        
$varName = (($selectType == BLOG_BY_USER_ID) ? "BLOG_USER1_CACHE_" "BLOG_USER_CACHE_");
        if (isset(
$GLOBALS["BLOG_USER"][$varName.$ID]) && is_array($GLOBALS["BLOG_USER"][$varName.$ID]) && is_set($GLOBALS["BLOG_USER"][$varName.$ID], "ID"))
        {
            return 
$GLOBALS["BLOG_USER"][$varName.$ID];
        }
        else
        {
            
$strSql =
                
"SELECT B.ID, B.USER_ID, B.ALIAS, B.DESCRIPTION, B.AVATAR, B.INTERESTS, ".
                
"    B.ALLOW_POST, ".
                
"    ".$DB->DateToCharFunction("B.LAST_VISIT""FULL")." as LAST_VISIT, ".
                
"    ".$DB->DateToCharFunction("B.DATE_REG""FULL")." as DATE_REG ".
                
"FROM b_blog_user B ".
                
"WHERE B.".(($selectType == BLOG_BY_USER_ID) ? "USER_ID" "ID")." = ".$ID."";
            
$dbResult $DB->Query($strSqlFalse"File: ".__FILE__."<br>Line: ".__LINE__);
            if (
$arResult $dbResult->Fetch())
            {
                
$GLOBALS["BLOG_USER"]["BLOG_USER_CACHE_".$arResult["ID"]] = $arResult;
                
$GLOBALS["BLOG_USER"]["BLOG_USER1_CACHE_".$arResult["USER_ID"]] = $arResult;
                return 
$arResult;
            }
        }

        return 
False;
    }