/** * Получает число новых тем и комментов где есть юзер * * @param int $sUserId ID пользователя * * @return int */ public function GetCountTrackNew($sUserId) { if (false === ($data = E::ModuleCache()->Get("track_count_new_user_{$sUserId}"))) { $data = $this->oMapper->GetCountTrackNew($sUserId); E::ModuleCache()->Set($data, "track_count_new_user_{$sUserId}", array('topic_update', 'topic_new', "topic_read_user_{$sUserId}"), 60 * 60 * 24); } return $data; }
/** * Получает число новых тем и комментов где есть юзер * * @param int $iUserId ID пользователя * * @return int */ public function GetCountTrackNew($iUserId) { $iUserId = (int) $iUserId; if (!$iUserId) { return false; } $sCacheKey = E::ModuleCache()->Key('track_count_new_user_', $iUserId); if (false === ($data = E::ModuleCache()->Get($sCacheKey, 'tmp,'))) { $data = $this->oMapper->GetCountTrackNew($iUserId); if ($iUserId == E::UserId()) { $sCacheType = ',tmp'; } else { $sCacheType = null; } E::ModuleCache()->Set($data, $sCacheKey, array('topic_update', 'topic_new', "topic_read_user_{$iUserId}"), 'P1D', $sCacheType); } return $data; }