Пример #1
0
 /**
  * @param ObjectManager $manager
  */
 public function load(ObjectManager $manager)
 {
     $lesson = new Lesson();
     $lesson->setActive(true)->setDate(new \DateTime('2015-09-08'))->setDuration(60)->setLevel($this->getReference('level1'))->setStart(new \DateTime('18:15:00'));
     $manager->persist($lesson);
     $lesson = new Lesson();
     $lesson->setActive(true)->setDate(new \DateTime('2015-09-15'))->setDuration(60)->setLevel($this->getReference('level1'))->setStart(new \DateTime('18:15:00'));
     $manager->persist($lesson);
     $lesson = new Lesson();
     $lesson->setActive(true)->setDate(new \DateTime('2015-09-29'))->setDuration(60)->setLevel($this->getReference('level2'))->setStart(new \DateTime('18:15:00'));
     $manager->persist($lesson);
     $lesson = new Lesson();
     $lesson->setActive(true)->setDate(new \DateTime('2015-09-17'))->setDuration(90)->setLevel($this->getReference('level3'))->setStart(new \DateTime('19:00:00'));
     $manager->persist($lesson);
     $manager->flush();
 }