#68 - reply working + remove marker on comment delete

This commit is contained in:
isUnknown 2024-12-18 18:22:41 +01:00
parent cf83edc1e6
commit 231bb21a4f
9 changed files with 64 additions and 95 deletions

View file

@ -5,21 +5,28 @@ namespace adrienpayet\D2P\data;
class Position
{
public int $pageIndex;
public float $x;
public float $y;
public ?float $x = null;
public ?float $y = null;
public function __construct(array $data)
{
$this->pageIndex = $data['pageIndex'];
$this->x = (float) $data['x'];
$this->y = (float) $data['y'];
if (isset($data["x"])) {
$this->x = (float) $data['x'];
$this->y = (float) $data['y'];
}
}
public function toArray() {
return [
$array = [
"pageIndex" => $this->pageIndex,
"x" => $this->x,
"y" => $this->y,
];
if ($this->x) {
$array["x"] = $this->x;
$array["y"] = $this->y;
}
return $array;
}
}

View file

@ -8,6 +8,7 @@ class Location
protected ?string $dialogUri = null;
protected ProjectDetails $project;
protected ?FileDetails $file = null;
protected ?string $parentCommentId = null;
public function __construct(array $data)
{
@ -18,6 +19,17 @@ class Location
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() {
@ -28,6 +40,9 @@ class Location
if ($this->dialogUri) {
$array["dialogUri"] = $this->dialogUri;
}
if ($this->file) {
$array["file"] = $this->file;
}