load() public method

So far there's no Database operation involved
public load ( $userid )
Exemplo n.º 1
0
 public function store($tweet, $author) {
   if (!$tweet->getId())
     $tweet->createId($author);
   HypertableConnection::insert('tweet', $tweet->getId(), 'message',
           $tweet->getMessage());
   $u=UserTable::load($author);
   $u->sendTweet($tweet);
   return true;
 }
Exemplo n.º 2
0
 public function followersAction()
 {
     $limit = 10;
     $request = $this->getRequest();
     $profile = Zend_Auth::getInstance()->getIdentity();
     $this->view->sendForm = $this->getSendForm();
     $this->view->show = 'followers';
     $user = UserTable::load($profile->getId());
     if (!$user) {
         return $this->render('index');
     }
     $this->view->data = $user->getFollowers($request->getParam('cutoff'), $limit);
     if (count($this->view->data) < $limit) {
         $this->view->new_cutoff_time = 0;
     } else {
         $this->view->new_cutoff_time = $user->getCutoffTime();
     }
     return $this->render('index');
 }
Exemplo n.º 3
0
  public function unfollowAction() {
    $request=$this->getRequest();
    $other=basename($request->getRequestUri());

    // load my own profile and user settings
    $profile=Zend_Auth::getInstance()->getIdentity();
    $user=UserTable::load($profile->getId());

    // check if we're following this user; if not, then return
    // to the frontpage
    if (!$user->isFollowing($other)) {
      return $this->_helper->redirector('index', 'index');
    }

    // otherwise remove 'other' from the follower list
    $user->unfollow($other);
    return $this->_helper->redirector->gotoUrl("/profile/show/$other");
  }