Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     $array = array(array('First article', 'testtesttestestest'), array('Second article', 'testtesttestestest2'), array('Third article', 'testtesttestestest3'));
     foreach ($array as $row) {
         $article = new Article();
         $article->setTitle($row[0]);
         $article->setHtml($row[1]);
         $article->setEnabled(true);
         $article->setDate(new \DateTime());
         $manager->persist($article);
         $this->addReference($row[0], $article);
     }
     $manager->flush();
 }