/** * @param UserEntity $user * @return bool|int */ public function findKey(UserEntity $user) { $it = $this->getIterator(); $it->rewind(); while ($it->valid()) { if ($it->current()->getId() == $user->getId()) { return $it->key(); } $it->next(); } return false; }
public function testGetSetId() { $this->user->setId(100); $this->assertEquals(100, $this->user->getId()); }