Example #1
0
 public function executeAdd()
 {
     $touserid = $this->getRequestParameter('id');
     $touser = UserPeer::retrieveByPK($touserid);
     $fromuserid = $this->getUser()->getAttribute('userid');
     $friend = new Friend();
     $friend->setUserId($touserid);
     $friend->save();
     $userfriend = new Userfriend();
     $userfriend->setUserId($fromuserid);
     $userfriend->setFriendId($friend->getId());
     $userfriend->save();
     $this->setFlash('notice', '<font style="background-color: yellow"><b>' . $touser->getFullname() . '</b>has been marked as friend.</font>');
     $this->redirect('search/result?page=' . $this->getUser()->getAttribute('srpage'));
 }
Example #2
0
 public function addUserfriend(Userfriend $l)
 {
     $this->collUserfriends[] = $l;
     $l->setFriend($this);
 }