CBlogPost::GetSocNetPermsName: Bitrix method

      
<?php 
//  CBlogPost :: GetSocNetPermsName()
//  /dist/bitrix/modules/blog/general/blog_post.php:1393

    
public static function GetSocNetPermsName($ID)
    {
        global 
$DB;
        
$ID IntVal($ID);
        if(
$ID <= 0)
            return 
false;

        
$arResult = Array();
        
$strSql "SELECT SR.ENTITY_TYPE, SR.ENTITY_ID, SR.ENTITY,
                        U.NAME as U_NAME, U.LAST_NAME as U_LAST_NAME, U.SECOND_NAME as U_SECOND_NAME, U.LOGIN as U_LOGIN, U.PERSONAL_PHOTO as U_PERSONAL_PHOTO, U.EXTERNAL_AUTH_ID as U_EXTERNAL_AUTH_ID,
                        EL.NAME as EL_NAME
                    FROM b_blog_socnet_rights SR
                    INNER JOIN b_blog_post P
                        ON (P.ID = SR.POST_ID)
                    LEFT JOIN b_user U
                        ON (U.ID = SR.ENTITY_ID AND SR.ENTITY_TYPE = 'U')
                    LEFT JOIN b_iblock_section EL
                        ON (EL.ID = SR.ENTITY_ID AND SR.ENTITY_TYPE = 'DR' AND EL.ACTIVE = 'Y')
                    WHERE
                        SR.POST_ID = "
.$ID;
        
$dbRes $DB->Query($strSqlfalse"File: ".__FILE__."<br>Line: ".__LINE__);
        while(
$arRes $dbRes->GetNext())
        {
            if(!
is_array($arResult[$arRes["ENTITY_TYPE"]][$arRes["ENTITY_ID"]]))
                
$arResult[$arRes["ENTITY_TYPE"]][$arRes["ENTITY_ID"]] = $arRes;
            if(!
is_array($arResult[$arRes["ENTITY_TYPE"]][$arRes["ENTITY_ID"]]["ENTITY"]))
                
$arResult[$arRes["ENTITY_TYPE"]][$arRes["ENTITY_ID"]]["ENTITY"] = Array();
            
$arResult[$arRes["ENTITY_TYPE"]][$arRes["ENTITY_ID"]]["ENTITY"][] = $arRes["ENTITY"];
        }
        return 
$arResult;
    }