$value) { if ($key == 'ID' || $key == 'id') { $this->id = $value; } else { $setterName = 'set' . ucfirst($key); if ( method_exists( $this, $setterName ) ) { $this->$setterName($value); } } } } } } public function getId() { return $this->id; } public function setId($id) { $this->id = $id; return $this; } }