public function testNotBlankValidation() { $notBlank = array('year', 'startDate', 'endDate'); $this->validateNotBlanks($notBlank); $this->object->setYear(2001); $this->object->setStartDate(new \DateTime()); $this->object->setEndDate(new \DateTime()); $this->validate(0); }
public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.curriculumInventoryReport')->getAll(); foreach ($data as $arr) { $entity = new CurriculumInventoryReport(); $entity->setId($arr['id']); $entity->setName($arr['name']); $entity->setDescription($arr['description']); $entity->setYear($arr['year']); $entity->setStartDate(new \DateTime($arr['startDate'])); $entity->setEndDate(new \DateTime($arr['endDate'])); $entity->setProgram($this->getReference('programs' . $arr['program'])); $manager->persist($entity); $this->addReference('curriculumInventoryReports' . $arr['id'], $entity); } $manager->flush(); }