public function addMicropetitionRootComment(Micropetition $micropetition) { $comment = new MicropetitionComment(); $comment->setPetition($micropetition); $comment->setCommentBody($micropetition->getPetitionBody()); $comment->setUser($micropetition->getUser()); return $this->saveNewComment($comment); }
public function load(ObjectManager $manager) { $firstComment = new Comment(); $firstComment->setCommentBody('comment'); $firstComment->setParentComment(null); $firstComment->setPetition($this->getReference('petition1')); $this->addReference('commentPetition1', $firstComment); $manager->persist($firstComment); $manager->flush(); }
public function setPetition(\Civix\CoreBundle\Entity\Micropetitions\Petition $petition = NULL) { $this->__load(); return parent::setPetition($petition); }