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

57 lines
1.3 KiB
PHP

<?php
namespace Mince;
use Index\DateTime;
use Index\Data\IDbResult;
use Index\Net\IPAddress;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
class VerificationInfo {
private string $code;
private string $uuid;
private string $name;
private string $addr;
private int $created;
public function __construct(IDbResult $result) {
$this->code = $result->getString(0);
$this->uuid = $result->getString(1);
$this->name = $result->getString(2);
$this->addr = $result->getString(3);
$this->created = $result->getInteger(4);
}
public function getCode(): string {
return $this->code;
}
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 getAddressRaw(): string {
return $this->addr;
}
public function getAddress(): IPAddress {
return IPAddress::parse($this->addr);
}
public function getCreatedTime(): int {
return $this->created;
}
public function getCreatedAt(): DateTime {
return DateTime::fromUnixTimeSeconds($this->created);
}
}