/** * Получает количество друзей * * @param int $nUserId ID пользователя * * @return int */ public function GetCountUsersFriend($nUserId) { $sCacheKey = "count_user_friend_{$nUserId}"; if (false === ($data = E::ModuleCache()->Get($sCacheKey))) { $data = $this->oMapper->GetCountUsersFriend($nUserId); E::ModuleCache()->Set($data, $sCacheKey, array("friend_change_user_{$nUserId}"), 'P2D'); } return $data; }
/** * Получает количество друзей * * @param int $sUserId ID пользователя * @return int */ public function GetCountUsersFriend($sUserId) { $sKey = "count_user_friend_{$sUserId}"; if (false === ($data = $this->Cache_Get($sKey))) { $data = $this->oMapper->GetCountUsersFriend($sUserId); $this->Cache_Set($data, $sKey, array("friend_change_user_{$sUserId}"), 60 * 60 * 24 * 2); } return $data; }