public function read($id) { $this->id = (int) $id; $this->readStatement->execute(); $result = $this->readStatement->get_result(); $event = new EventsObject(); while ($row = $result->fetch_object()) { $event->setName($row->name); $event->setDescription($row->description); $event->setDate($row->date); $event->setImage($row->image); } return $event; }