private function populate() { $sport = new Article(); $sport->setTitle('Sport'); $sport->setCode('test'); $this->dm->persist($sport); $cars = new Article(); $cars->setTitle('Cars'); $cars->setCode('code'); $this->dm->persist($cars); $thomas = new RelativeSlug(); $thomas->setTitle('Thomas'); $thomas->setArticle($sport); $this->dm->persist($thomas); $jen = new RelativeSlug(); $jen->setTitle('Jen'); $jen->setArticle($sport); $this->dm->persist($jen); $john = new RelativeSlug(); $john->setTitle('John'); $john->setArticle($cars); $this->dm->persist($john); $single = new RelativeSlug(); $single->setTitle('Single'); $this->dm->persist($single); $this->dm->flush(); }
private function populate() { $art0 = new Article(); $art0->setTitle('My Title'); $art0->setCode('The Code'); $this->dm->persist($art0); $this->dm->flush(); $this->dm->clear(); }