예제 #1
0
 public function testGetSetCountry()
 {
     $country = CountryFactory::generate('GBR');
     $this->person->setCountry($country);
     $this->assertInstanceOf('Del\\Entity\\Country', $this->person->getCountry());
     $this->assertEquals('GBR', $this->person->getCountry()->getId());
 }
예제 #2
0
 /** 
  * @param array $data
  * @return Person
  */
 public function createFromArray(array $data)
 {
     $person = new Person();
     isset($data['id']) ? $person->setId($data['id']) : null;
     isset($data['firstname']) ? $person->setFirstname($data['firstname']) : null;
     isset($data['middlename']) ? $person->setMiddlename($data['middlename']) : null;
     isset($data['lastname']) ? $person->setLastname($data['lastname']) : null;
     isset($data['aka']) ? $person->setAka($data['aka']) : null;
     isset($data['dob']) ? $person->setDob($data['dob']) : null;
     isset($data['birthplace']) ? $person->setBirthplace($data['birthplace']) : null;
     isset($data['country']) ? $person->setCountry($data['country']) : null;
     return $person;
 }