コード例 #1
0
 /**
  * Load data to database.
  *
  * @param ObjectManager $em Doctrine entity manager
  */
 public function load(ObjectManager $em)
 {
     $contextRegles = new Context();
     $contextRegles->setId('contexte');
     $contextRegles->setEnabled(true);
     $contextRegles->setName('Contexte');
     $em->persist($contextRegles);
     $contextJeuDeRole = new Context();
     $contextJeuDeRole->setId('rp');
     $contextJeuDeRole->setEnabled(true);
     $contextJeuDeRole->setName('RP');
     $em->persist($contextJeuDeRole);
     $contextPersonnage = new Context();
     $contextPersonnage->setId('personnage');
     $contextPersonnage->setEnabled(true);
     $contextPersonnage->setName('Personnages');
     $em->persist($contextPersonnage);
     $contextHorsJeu = new Context();
     $contextHorsJeu->setId('hj');
     $contextHorsJeu->setEnabled(true);
     $contextHorsJeu->setName('Hors-jeu');
     $em->persist($contextHorsJeu);
     $em->flush();
     $this->addReference('context-regles', $contextRegles);
     $this->addReference('context-rp', $contextJeuDeRole);
     $this->addReference('context-hj', $contextHorsJeu);
     $this->addReference('context-personnages', $contextPersonnage);
 }
コード例 #2
0
 /**
  * Load data to database.
  *
  * @param ObjectManager $em Doctrine entity manager
  */
 public function load(ObjectManager $em)
 {
     $defaultContext = new Context();
     $defaultContext->setId('default');
     $defaultContext->setEnabled(true);
     $defaultContext->setName('Classement');
     $em->persist($defaultContext);
     $siteContext = new Context();
     $siteContext->setId('site');
     $siteContext->setEnabled(true);
     $siteContext->setName('Site');
     $em->persist($siteContext);
     $em->flush();
     $this->addReference('default-context', $defaultContext);
     $this->addReference('site-context', $siteContext);
 }
コード例 #3
0
 public function load(ObjectManager $manager)
 {
     $context = new Context();
     $context->setId(1);
     $context->setName('Default');
     $context->setEnabled(true);
     $context->setCreatedAt(new \DateTime());
     $context->setUpdatedAt(new \DateTime());
     $category = new Category();
     $category->setName('Default');
     $category->setContext($context);
     $category->setEnabled(true);
     $category->setSlug('default');
     $category->setCreatedAt(new \DateTime());
     $category->setUpdatedAt(new \DateTime());
     $manager->persist($category);
     $manager->flush();
 }
コード例 #4
0
 public function load(ObjectManager $manager)
 {
     $context4 = new Context();
     $context4->setId('default');
     $context4->setName('default');
     $context4->setEnabled(1);
     $context4->setCreatedAt(new \DateTime());
     $context4->setUpdatedAt(new \DateTime());
     $manager->persist($context4);
     $context1 = new Context();
     $context1->setId('intro');
     $context1->setName('intro');
     $context1->setEnabled(1);
     $context1->setCreatedAt(new \DateTime());
     $context1->setUpdatedAt(new \DateTime());
     $manager->persist($context1);
     $context2 = new Context();
     $context2->setId('bgimage');
     $context2->setName('bgimage');
     $context2->setEnabled(1);
     $context2->setCreatedAt(new \DateTime());
     $context2->setUpdatedAt(new \DateTime());
     $manager->persist($context2);
     $context3 = new Context();
     $context3->setId('icons');
     $context3->setName('icons');
     $context3->setEnabled(1);
     $context3->setCreatedAt(new \DateTime());
     $context3->setUpdatedAt(new \DateTime());
     $manager->persist($context3);
     $manager->flush();
     $this->addReference('context4', $context4);
     $this->addReference('context1', $context1);
     $this->addReference('context2', $context2);
     $this->addReference('context3', $context3);
 }