Example #1
0
 public function load(ObjectManager $manager)
 {
     $data = $this->container->get('ilioscore.dataloader.vocabulary')->getAll();
     foreach ($data as $arr) {
         $entity = new Vocabulary();
         $entity->setId($arr['id']);
         $entity->setTitle($arr['title']);
         $entity->setActive($arr['active']);
         $entity->setSchool($this->getReference('schools' . $arr['school']));
         $manager->persist($entity);
         $this->addReference('vocabularies' . $arr['id'], $entity);
     }
     $manager->flush();
 }
Example #2
0
 /**
  * @covers \Ilios\CoreBundle\Entity\Vocabulary::__construct
  */
 public function testConstructor()
 {
     $this->assertEmpty($this->object->getTerms());
 }