Your User
class exchangeArray
method is used to populate properties with db values, it currently doesn't reference the id
.
public function exchangeArray($data)
{
// populate the id
$this->id = isset($data['id']) ? $data['id'] : null;
$this->name = (isset($data['name'])) ?
$data['name'] : null;
$this->email = (isset($data['email'])) ?
$data['email'] : null;
if (isset($data['password']))
{
$this->setPassword($data['password']);
}
}