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(); }
/** * @covers Ilios\CoreBundle\Entity\Topic::__construct */ public function testConstructor() { $this->assertEmpty($this->object->getCourses()); $this->assertEmpty($this->object->getProgramYears()); $this->assertEmpty($this->object->getSessions()); }