examples/retwitter/application/controllers/UserController.php
public function followAction()
    {
        $auth = Zend_Auth::getInstance();
        if (!$auth->hasIdentity()) {
            throw new Zend_Auth_Exception("You're not authorized to see this page");
        }
        
        $userId = $this->_getParam('userId');
        $follower = $auth->getStorage()->read();
        
        if ($userId != $follower['id']) {
            $followers = new Followers($userId);
            $followers[] = $follower['id'];
            
            $following = new Following($follower['id']);
            $following[] = $userId;
        }
        $this->_redirect('/user/followers/userId/' . $userId);
    }
public function followAction()
    {
        $auth = Zend_Auth::getInstance();
        if (!$auth->hasIdentity()) {
            throw new Zend_Auth_Exception("You're not authorized to see this page");
        }
        
        $userId = $this->_getParam('userId');
        $follower = $auth->getStorage()->read();
        
        if ($userId != $follower['id']) {
            $followers = new Followers($userId);
            $followers[] = $follower['id'];
            
            $following = new Following($follower['id']);
            $following[] = $userId;
        }
        $this->_redirect('/user/followers/userId/' . $userId);
    }
Start following given userId