private function populate() { $article = new Article(); $article->setTitle('title in en'); $article->setContent('content in en'); $comment1 = new Comment(); $comment1->setSubject('subject1 in en'); $comment1->setMessage('message1 in en'); $comment2 = new Comment(); $comment2->setSubject('subject2 in en'); $comment2->setMessage('message2 in en'); $article->addComment($comment1); $article->addComment($comment2); $this->em->persist($article); $this->em->persist($comment1); $this->em->persist($comment2); $this->em->flush(); $this->articleId = $article->getId(); $this->em->clear(); }