/** * Получает список друзей * * @param int $sUserId ID пользователя * @param int $iPage Номер страницы * @param int $iPerPage Количество элементов на страницу * @return array */ public function GetUsersFriend($sUserId, $iPage = 1, $iPerPage = 10) { $sKey = "user_friend_{$sUserId}_{$iPage}_{$iPerPage}"; if (false === ($data = $this->Cache_Get($sKey))) { $data = array('collection' => $this->oMapper->GetUsersFriend($sUserId, $iCount, $iPage, $iPerPage), 'count' => $iCount); $this->Cache_Set($data, $sKey, array("friend_change_user_{$sUserId}"), 60 * 60 * 24 * 2); } $data['collection'] = $this->GetUsersAdditionalData($data['collection']); return $data; }
/** * Получает список друзей * * @param int $nUserId ID пользователя * @param int $iPage Номер страницы * @param int $iPerPage Количество элементов на страницу * * @return array */ public function GetUsersFriend($nUserId, $iPage = 1, $iPerPage = 10) { $sCacheKey = "user_friend_{$nUserId}_{$iPage}_{$iPerPage}"; if (false === ($data = E::ModuleCache()->Get($sCacheKey))) { $data = array('collection' => $this->oMapper->GetUsersFriend($nUserId, $iCount, $iPage, $iPerPage), 'count' => $iCount); E::ModuleCache()->Set($data, $sCacheKey, array("friend_change_user_{$nUserId}"), 'P2D'); } if ($data['collection']) { $data['collection'] = $this->GetUsersAdditionalData($data['collection']); } return $data; }