#68 - refactor some of the notification classes to classes plugin to share them with comments
This commit is contained in:
parent
6ab18b1066
commit
3d4ddc12fc
9 changed files with 22 additions and 105 deletions
25
public/site/plugins/classes/Position.php
Normal file
25
public/site/plugins/classes/Position.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace adrienpayet\D2P\data;
|
||||
|
||||
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,
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue