mince/src/AccountLinkInfo.php
2023-08-22 23:47:37 +00:00

46 lines
1 KiB
PHP

<?php
namespace Mince;
use Index\DateTime;
use Index\Data\IDbResult;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
class AccountLinkInfo {
private string $userId;
private string $uuid;
private string $name;
private int $created;
public function __construct(IDbResult $result) {
$this->userId = $result->getString(0);
$this->uuid = $result->getString(1);
$this->name = $result->getString(2);
$this->created = $result->getInteger(3);
}
public function getUserId(): string {
return $this->userId;
}
public function getUUIDRaw(): string {
return $this->uuid;
}
public function getUUID(): UuidInterface {
return Uuid::fromBytes($this->uuid);
}
public function getName(): string {
return $this->name;
}
public function getCreatedTime(): int {
return $this->created;
}
public function getCreatedAt(): DateTime {
return DateTime::fromUnixTimeSeconds($this->created);
}
}