26 lines
486 B
PHP
26 lines
486 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace adrienpayet\notifications;
|
||
|
|
|
||
|
|
class Position
|
||
|
|
{
|
||
|
|
public int $pageIndex;
|
||
|
|
public float $x;
|
||
|
|
public float $y;
|
||
|
|
|
||
|
|
public function __construct(array $data)
|
||
|
|
{
|
||
|
|
$this->pageIndex = $data['pageIndex'];
|
||
|
|
$this->x = (float) $data['x'];
|
||
|
|
$this->y = (float) $data['y'];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function toArray() {
|
||
|
|
return [
|
||
|
|
"pageIndex" => $this->pageIndex,
|
||
|
|
"x" => $this->x,
|
||
|
|
"y" => $this->y,
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|