Пример #1
0
 /**
  * @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;
 }
Пример #2
0
 public function testGetSetId()
 {
     $this->person->setId(100);
     $this->assertEquals(100, $this->person->getId());
 }
Пример #3
0
 /**
  * @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;
 }