Example #1
0
 public function testNotBlankValidation()
 {
     $notBlank = array('startYear');
     $this->validateNotBlanks($notBlank);
     $this->object->setStartYear(3);
     $this->validate(0);
 }
Example #2
0
 public function testNotNullValidation()
 {
     $notNull = array('program');
     $this->object->setStartYear(3);
     $this->validateNotNulls($notNull);
     $this->object->setProgram(m::mock('Ilios\\CoreBundle\\Entity\\ProgramInterface'));
     $this->validate(0);
 }
Example #3
0
 public function load(ObjectManager $manager)
 {
     $data = $this->container->get('ilioscore.dataloader.programYear')->getAll();
     foreach ($data as $arr) {
         $entity = new ProgramYear();
         $entity->setId($arr['id']);
         $entity->setStartYear($arr['startYear']);
         $entity->setLocked($arr['locked']);
         $entity->setArchived($arr['archived']);
         $entity->setPublishedAsTbd($arr['publishedAsTbd']);
         $entity->setPublished($arr['published']);
         $entity->setProgram($this->getReference('programs' . $arr['program']));
         foreach ($arr['terms'] as $id) {
             $entity->addTerm($this->getReference('terms' . $id));
         }
         foreach ($arr['objectives'] as $id) {
             $entity->addObjective($this->getReference('objectives' . $id));
         }
         foreach ($arr['competencies'] as $id) {
             $entity->addCompetency($this->getReference('competencies' . $id));
         }
         $manager->persist($entity);
         $this->addReference('programYears' . $arr['id'], $entity);
     }
     $manager->flush();
 }
Example #4
0
 public function load(ObjectManager $manager)
 {
     $data = $this->container->get('ilioscore.dataloader.programYear')->getAll();
     foreach ($data as $arr) {
         $entity = new ProgramYear();
         $entity->setId($arr['id']);
         $entity->setStartYear($arr['startYear']);
         $entity->setDeleted($arr['deleted']);
         $entity->setLocked($arr['locked']);
         $entity->setArchived($arr['archived']);
         $entity->setPublishedAsTbd($arr['publishedAsTbd']);
         if (!empty($arr['publishEvent'])) {
             $entity->setPublishEvent($this->getReference('publishEvents' . $arr['publishEvent']));
         }
         $entity->setProgram($this->getReference('programs' . $arr['program']));
         $manager->persist($entity);
         $this->addReference('programYears' . $arr['id'], $entity);
     }
     $manager->flush();
 }