type = $data["type"]; $this->location = new Location($data["location"]); $this->text = $data["text"]; $this->author = new Author($data["author"]); $this->date = $data["date"]; $this->id = $data["id"]; $this->isRead = "false"; } public function toArray() { return [ 'location' => $this->location, 'position' => $this->position, 'replies' => $this->replies, 'text' => $this->text, 'author' => $this->author, 'date' => $this->date, 'id' => $this->id, 'type' => $this->type, 'isRead' => $this->isRead ]; } }