コード例 #1
0
ファイル: DepartmentTest.php プロジェクト: stopfstedt/ilios
 public function testNotNullValidation()
 {
     $notNull = array('school');
     $this->object->setTitle('test');
     $this->validateNotNulls($notNull);
     $this->object->setSchool(m::mock('Ilios\\CoreBundle\\Entity\\SchoolInterface'));
     $this->validate(0);
 }
コード例 #2
0
ファイル: LoadDepartmentData.php プロジェクト: Okami-/ilios
 public function load(ObjectManager $manager)
 {
     $data = $this->container->get('ilioscore.dataloader.department')->getAll();
     foreach ($data as $arr) {
         $entity = new Department();
         $entity->setId($arr['id']);
         $entity->setTitle($arr['title']);
         $entity->setSchool($this->getReference('schools' . $arr['school']));
         $manager->persist($entity);
         $this->addReference('departments' . $arr['id'], $entity);
     }
     $manager->flush();
 }