CBlogPost :: getSocNetPerms: Bitrix method

      
<?php 
//  CBlogPost :: getSocNetPerms()
//  /dist/bitrix/modules/blog/general/blog_post.php:1347

    
public static function getSocNetPerms($ID$useCache true)
    {
        global 
$DB$CACHE_MANAGER;
        
$ID IntVal($ID);
        if(
$ID <= 0)
            return 
false;

        
$arResult = array();

        
$cacheTtl defined("BX_COMP_MANAGED_CACHE") ? 3153600 3600*4;
        
$cacheId 'blog_post_getsocnetperms_'.$ID;
        
$cacheDir '/blog/getsocnetperms/'.$ID;

        
$obCache = new CPHPCache;
        if(
            
$obCache->InitCache($cacheTtl$cacheId$cacheDir)
            && 
$useCache
        
)
        {
            
$arResult $obCache->GetVars();
        }
        else
        {
            
$obCache->StartDataCache();

            
$strSql "SELECT SR.ENTITY_ID, SR.ENTITY_TYPE, SR.ENTITY FROM b_blog_socnet_rights SR
                INNER JOIN b_blog_post P ON (P.ID = SR.POST_ID)
                WHERE SR.POST_ID="
.$ID." ORDER BY SR.ENTITY ASC";
            
$dbRes $DB->Query($strSqlfalse"File: ".__FILE__."<br>Line: ".__LINE__);
            while(
$arRes $dbRes->Fetch())
            {
                
$arResult[$arRes["ENTITY_TYPE"]][$arRes["ENTITY_ID"]][] = $arRes["ENTITY"];
            }

            if(
defined("BX_COMP_MANAGED_CACHE"))
            {
                
$CACHE_MANAGER->StartTagCache($cacheDir);
                
$CACHE_MANAGER->RegisterTag("blog_post_getsocnetperms_".$ID);
                
$CACHE_MANAGER->EndTagCache();
            }
            
$obCache->EndDataCache($arResult);
        }

        return 
$arResult;
    }