/** * Получить все комменты сгрупированные по типу(для вывода прямого эфира) * * @param string $sTargetType Тип владельца комментария * @param int $iLimit Количество элементов * @return array */ public function GetCommentsOnline($sTargetType, $iLimit) { /** * Исключаем из выборки идентификаторы закрытых блогов (target_parent_id) */ $aCloseBlogs = $this->oUserCurrent ? $this->Blog_GetInaccessibleBlogsByUser($this->oUserCurrent) : $this->Blog_GetInaccessibleBlogsByUser(); $s = serialize($aCloseBlogs); if (false === ($data = $this->Cache_Get("comment_online_{$sTargetType}_{$s}_{$iLimit}"))) { $data = $this->oMapper->GetCommentsOnline($sTargetType, $aCloseBlogs, $iLimit); $this->Cache_Set($data, "comment_online_{$sTargetType}_{$s}_{$iLimit}", array("comment_online_update_{$sTargetType}"), 60 * 60 * 24 * 1); } $data = $this->GetCommentsAdditionalData($data); return $data; }