/** * @param PersonEntity $person * @return bool|int */ public function findKey(PersonEntity $person) { $it = $this->getIterator(); $it->rewind(); while ($it->valid()) { if ($it->current()->getId() == $person->getId()) { return $it->key(); } $it->next(); } return false; }
public function testGetSetId() { $this->person->setId(100); $this->assertEquals(100, $this->person->getId()); }
/** * @param Person $person * @return array */ public function toArray(Person $person) { $data = ['id' => $person->getId(), 'firstname' => $person->getFirstname(), 'middlename' => $person->getMiddlename(), 'lastname' => $person->getLastname(), 'aka' => $person->getAka(), 'dob' => $person->getDob(), 'birthplace' => $person->getBirthplace(), 'country' => $person->getCountry()]; return $data; }