public function testNotNullValidation() { $notNull = array('user'); $this->object->setType('test'); $this->object->setProperty('test'); $this->object->setValue('test'); $this->validateNotNulls($notNull); $this->object->setUser(new User()); $this->validate(0); }
public function load(ObjectManager $manager) { $data = $this->container->get('ilioscore.dataloader.pendinguserupdate')->getAll(); foreach ($data as $arr) { $entity = new PendingUserUpdate(); $entity->setId($arr['id']); $entity->setType($arr['type']); $entity->setProperty($arr['property']); $entity->setValue($arr['value']); $entity->setUser($this->getReference('users' . $arr['user'])); $manager->persist($entity); $this->addReference('pendingUserUpdates' . $arr['id'], $entity); } $manager->flush(); }