2024-12-18 13:56:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
2024-12-18 15:05:42 +01:00
|
|
|
namespace adrienpayet\D2P\data;
|
2024-12-18 13:56:21 +01:00
|
|
|
|
|
|
|
|
class Author
|
|
|
|
|
{
|
|
|
|
|
protected string $name;
|
|
|
|
|
protected string $email;
|
|
|
|
|
protected string $uuid;
|
|
|
|
|
protected string $role;
|
|
|
|
|
|
|
|
|
|
public function __construct($author) {
|
|
|
|
|
$this->name = (string) $author->name();
|
|
|
|
|
$this->email = (string) $author->email();
|
|
|
|
|
$this->uuid = (string) $author->uuid();
|
|
|
|
|
$this->role = (string) $author->role();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function toArray() {
|
|
|
|
|
return [
|
|
|
|
|
"name" => $this->name,
|
|
|
|
|
"email" => $this->email,
|
|
|
|
|
"uuid" => $this->uuid,
|
|
|
|
|
"role" => $this->role,
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|