designtopack/public/site/plugins/classes/Position.php
isUnknown 1ae2964d58 Revert "improve comments system"
This reverts commit e55eb48f45.
2025-01-28 09:47:58 +01:00

36 lines
727 B
PHP

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