public function load(ObjectManager $manager) { $firstComment = new Comment(); $firstComment->setCommentBody('comment'); $firstComment->setParentComment(null); $firstComment->setQuestion($this->getReference('question1')); $this->addReference('comment1', $firstComment); $manager->persist($firstComment); $manager->flush(); }
public function addPollRootComment(Question $question, $message = '') { $comment = new Comment(); $comment->setQuestion($question)->setCommentBody($message); return $this->saveNewComment($comment); }
public function setQuestion(\Civix\CoreBundle\Entity\Poll\Question $question = NULL) { $this->__load(); return parent::setQuestion($question); }