예제 #1
0
 public function load(ObjectManager $manager)
 {
     $data = $this->container->get('ilioscore.dataloader.topic')->getAll();
     foreach ($data as $arr) {
         $entity = new Topic();
         $entity->setId($arr['id']);
         $entity->setTitle($arr['title']);
         if (!empty($arr['school'])) {
             $entity->setSchool($this->getReference('schools' . $arr['school']));
         }
         $manager->persist($entity);
         $this->addReference('topics' . $arr['id'], $entity);
     }
     $manager->flush();
 }
예제 #2
0
파일: TopicTest.php 프로젝트: Okami-/ilios
 /**
  * @covers Ilios\CoreBundle\Entity\Topic::__construct
  */
 public function testConstructor()
 {
     $this->assertEmpty($this->object->getCourses());
     $this->assertEmpty($this->object->getProgramYears());
     $this->assertEmpty($this->object->getSessions());
 }