/** * @test */ public function getLatestCommentByUserId() { $user = new User(); $aUser = $user->selectOne("user_name", "test1"); $this->insertComments($aUser); $this->eq("comment3", Status::getLatestCommentByUserId($aUser->id)); $this->clear("Status"); }
protected function logicsStatusRemove($userId, $statusId, $result) { if ($result->isFailure()) { return; } $cache = UserCache::getInstance(); list($fp, $data) = $cache->lock($userId); if ($data) { $data["statuses"]--; $data["comment"] = Status::getLatestCommentByUserId($userId); $cache->write($fp, $data); } }
protected function _getUserData($userId) { return array("friends" => Follower::getFriendsCount($userId), "followers" => Follower::getFollowersCount($userId), "statuses" => Status::getCountByUserId($userId), "comment" => Status::getLatestCommentByUserId($userId)); }