Example #1
0
 /**
  * @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");
 }
Example #2
0
 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);
     }
 }
Example #3
0
 protected function _getUserData($userId)
 {
     return array("friends" => Follower::getFriendsCount($userId), "followers" => Follower::getFollowersCount($userId), "statuses" => Status::getCountByUserId($userId), "comment" => Status::getLatestCommentByUserId($userId));
 }