designtopack/public/site/plugins/notifications/src/Position.php

26 lines
486 B
PHP
Raw Normal View History

<?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,
];
}
}