content notification read working
This commit is contained in:
parent
ffb8252808
commit
94c5737245
21 changed files with 317 additions and 163 deletions
|
|
@ -8,7 +8,7 @@ class Location
|
|||
protected ?string $dialogUri = null;
|
||||
protected ProjectDetails $project;
|
||||
protected ?FileDetails $file = null;
|
||||
protected ?string $parentCommentId = null;
|
||||
protected ?array $parent = null;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
|
|
@ -19,19 +19,17 @@ class Location
|
|||
if (isset($data['file'])) {
|
||||
$this->file = new FileDetails($data["file"]);
|
||||
}
|
||||
if (isset($data["parentCommentId"])) {
|
||||
$this->parentCommentId();
|
||||
if (isset($data["parent"])) {
|
||||
$this->parent = [
|
||||
"author" => [
|
||||
"name" => $data["parent"]["author"]["name"],
|
||||
"email" => $data["parent"]["author"]["email"],
|
||||
],
|
||||
"id" => $data["parent"]["id"]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function setParentCommentId($id) {
|
||||
$this->parentCommentId = $id;
|
||||
}
|
||||
|
||||
public function parentId() {
|
||||
return $this->parentCommentId;
|
||||
}
|
||||
|
||||
public function toArray() {
|
||||
$array = [
|
||||
"page" => $this->page->toArray(),
|
||||
|
|
@ -46,8 +44,8 @@ class Location
|
|||
$array["file"] = $this->file;
|
||||
}
|
||||
|
||||
if ($this->parentCommentId) {
|
||||
$array["parentId"] = $this->parentCommentId;
|
||||
if ($this->parent) {
|
||||
$array["parent"] = $this->parent;
|
||||
}
|
||||
|
||||
return $array;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue