page = new PageDetails($data["page"]); $this->dialogUri = $data["dialogUri"]; $this->project = new ProjectDetails($data["project"]); if (isset($data['file'])) { $this->file = new FileDetails($data["file"]); } if (isset($data["parentCommentId"])) { $this->parentCommentId(); } } public function setParentCommentId($id) { $this->parentCommentId = $id; } public function parentId() { return $this->parentCommentId; } public function toArray() { $array = [ "page" => $this->page->toArray(), "project" => $this->project->toArray(), ]; if ($this->dialogUri) { $array["dialogUri"] = $this->dialogUri; } if ($this->file) { $array["file"] = $this->file; } return $array; } }