27 lines
No EOL
601 B
PHP
27 lines
No EOL
601 B
PHP
<?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;
|
|
|
|
return $array;
|
|
}
|
|
} |