Exemplo n.º 1
0
 public function executeVote()
 {
     $this->answer = AnswerPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($this->answer);
     $user = $this->getUser()->getSubscriber();
     $relevancy = new Relevancy();
     $relevancy->setAnswer($this->answer);
     $relevancy->setUser($user);
     $relevancy->setScore($this->getRequestParameter('score') == 1 ? 1 : -1);
     $relevancy->save();
 }
Exemplo n.º 2
0
 public function addRelevancy(Relevancy $l)
 {
     $this->collRelevancys[] = $l;
     $l->setUser($this);
 }