Exemplo n.º 1
0
 public function addCommentByQuestionAnswer(Answer $answer)
 {
     $parent = $this->em->getRepository('CivixCoreBundle:Poll\\Comment')->findOneBy(array('question' => $answer->getQuestion(), 'parentComment' => null));
     if ($answer->getComment()) {
         $comment = new Comment();
         $comment->setUser($answer->getUser())->setCommentBody($answer->getComment())->setQuestion($answer->getQuestion())->setPrivacy($answer->getPrivacy())->setParentComment($parent);
         return $this->saveNewComment($comment);
     }
 }
 public function setUser(\Civix\CoreBundle\Entity\User $user = NULL)
 {
     $this->__load();
     return parent::setUser($user);
 }