CBlogPost :: GetSocNetPostsPerms: Bitrix method

      
<?php 
//  CBlogPost :: GetSocNetPostsPerms()
//  /dist/bitrix/modules/blog/general/blog_post.php:1470

    
public static function GetSocNetPostsPerms($entity_type$entity_id)
    {
        global 
$DB;
        
$entity_id IntVal($entity_id);
        if(
$entity_id <= 0)
            return 
false;

        
$type "U";
        
$type2 "US";
        if(
$entity_type == "G")
            
$type $type2 "SG";

        
$arResult = Array();
        
$dbRes $DB->Query("
            SELECT SR.POST_ID, SR.ENTITY, SR.ENTITY_ID, SR.ENTITY_TYPE FROM b_blog_socnet_rights SR
            WHERE
                SR.POST_ID IN (SELECT POST_ID FROM b_blog_socnet_rights WHERE ENTITY_TYPE='"
.$type."' AND ENTITY_ID=".$entity_id." AND ENTITY = '".$type.$entity_id."')
                AND SR.ENTITY <> '"
.$type2.$entity_id."'
        "
false"File: ".__FILE__."<br>Line: ".__LINE__);
        while(
$arRes $dbRes->Fetch())
        {
            
$arResult[$arRes["POST_ID"]]["PERMS"][] = $arRes["ENTITY"];
            
$arResult[$arRes["POST_ID"]]["PERMS_FULL"][$arRes["ENTITY_TYPE"].$arRes["ENTITY_ID"]] = Array("TYPE" => $arRes["ENTITY_TYPE"], "ID" => $arRes["ENTITY_ID"]);
        }
        return 
$arResult;
    }