public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.curriculumInventoryInstitution')->getAll(); foreach ($data as $arr) { $entity = new CurriculumInventoryInstitution(); if (!empty($arr['school'])) { $entity->setSchool($this->getReference('schools' . $arr['school'])); } $entity->setId($arr['id']); $entity->setName($arr['name']); $entity->setAamcCode($arr['aamcCode']); $entity->setAddressStreet($arr['addressStreet']); $entity->setAddressCity($arr['addressCity']); $entity->setAddressStateOrProvince($arr['addressStateOrProvince']); $entity->setAddressZipCode($arr['addressZipCode']); $entity->setAddressCountryCode($arr['addressCountryCode']); $manager->persist($entity); $this->addReference('curriculumInventoryInstitutions' . $arr['name'], $entity); } $manager->flush(); }