Beispiel #1
0
  public function load($id) {
    $result=HypertableConnection::query("SELECT * FROM tweet ".
                "WHERE ROW='$id'");
    if (!$result or !count($result->cells))
      return null;

    $tweet=new Tweet();
    $tweet->setId($id);
    $tweet->setTimestamp($result->cells[0]->key->timestamp);
    $tweet->setMessage($result->cells[0]->value);
    return $tweet;
  }
 public function load($id) {
   $result=HypertableConnection::query("SELECT * FROM profile ".
               "WHERE ROW='$id'");
   if (!$result or !count($result->cells))
       return null;
   $profile=new Profile();
   $profile->setId($id);
   $profile->setDisplayName($result->cells[1]->value);
   $profile->setPasswordMd5($result->cells[2]->value);
   $profile->setEmail($result->cells[3]->value);
   $profile->setAvatar($result->cells[4]->value);
   $profile->setLocation($result->cells[5]->value);
   $profile->setWebpage($result->cells[6]->value);
   $profile->setBio($result->cells[7]->value);
   return $profile;
 }
Beispiel #3
0
 public function getFollowStream($cutoff_time, $limit) {
   $a=array();
   $id=$this->_id;
   if ($cutoff_time)
     $t="AND TIMESTAMP < '".
        HypertableConnection::format_timestamp_ns($cutoff_time)."' ";
   else
     $t='';
   $result=HypertableConnection::query("SELECT follow_stream FROM user ".
               "WHERE ROW='$id' $t CELL_LIMIT $limit");
   if (!$result or !count($result->cells))
     return $a;
   foreach ($result->cells as $cell) {
     array_push($a, TweetTable::load($cell->value));
   }
   $this->_cutoff=$result->cells[count($result->cells)-1]->key->timestamp;
   return $a;
 }