#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

@ -1,24 +1,18 @@
<?php
namespace adrienpayet\comments;
use adrienpayet\D2P\data\Position;
class Comment extends BaseComment
{
protected ?Position $position = null;
protected string $type = "comment";
protected array $replies = [];
public function __construct($data) {
parent::__construct($data);
if (isset($data["position"])) {
$this->position = new Position($data['position']);
}
}
public function toArray() {
$array = parent::toArray();
$array['position'] = $this->position;
$array['type'] = $this->type;
$array['replies'] = $this->replies;