コード例 #1
0
ファイル: Admin.class.php プロジェクト: lunavod/bunker_stable
 /**
  * Получить все блоги всех типов
  *
  * @param   integer $iCount
  * @param   integer $iCurrPage
  * @param   integer $iPerPage
  * @param   array   $aParam
  * @return  array
  */
 public function GetBlogList($iCount, $iCurrPage, $iPerPage, $aParam = array())
 {
     $sCacheKey = 'adm_blog_list_' . $iCurrPage . '_' . $iPerPage . '_' . serialize($aParam);
     if (false === ($data = $this->Cache_Get($sCacheKey))) {
         $data = array('collection' => $this->oMapper->GetBlogList($iCount, $iCurrPage, $iPerPage, $aParam), 'count' => $iCount);
         if ($data['collection']) {
             foreach ($data['collection'] as $sBlogId => $aBlog) {
                 if ($aBlog['blog_type'] == 'personal') {
                     $data['collection'][$sBlogId]['blog_url_full'] = Router::GetPath('my') . $aBlog['user_login'] . '/';
                 } else {
                     $data['collection'][$sBlogId]['blog_url_full'] = Router::GetPath('blog') . $aBlog['blog_url'] . '/';
                 }
             }
         }
         $this->Cache_Set($data, $sCacheKey, array('blog_update', 'blog_new'), 60 * 15);
     }
     return $data;
 }