Exemplo n.º 1
0
 public function searchAction()
 {
     $request = $this->getRequest();
     $name = $request->getParam("username");
     if (empty($name)) {
         $this->_redirect("post/home");
     }
     $user_mapper = new Application_Model_UserMapper();
     $followed = $user_mapper->findByColumn("username", $name);
     if (empty($followed)) {
         $this->_redirect("post/home");
     }
     $followed_id = $followed["id"];
     $follower_id = get_user_id();
     $follow_mapper = new Application_Model_FollowMapper();
     $follow_mapper->InsertFollower($follower_id, $followed_id);
     $this->_redirect("post/home");
 }