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(); }
public function addRelevancy(Relevancy $l) { $this->collRelevancys[] = $l; $l->setUser($this); }