mince/src/CapeInfo.php
2024-02-21 16:08:45 +00:00

38 lines
817 B
PHP

<?php
namespace Mince;
use Index\DateTime;
use Index\Data\IDbResult;
class CapeInfo {
public function __construct(
private string $userId,
private string $hash,
private int $updated,
) {}
public static function fromResult(IDbResult $result): self {
return new CapeInfo(
userId: $result->getString(0),
hash: $result->getString(1),
updated: $result->getInteger(2),
);
}
public function getUserId(): string {
return $this->userId;
}
public function getHash(): string {
return $this->hash;
}
public function getUpdatedTime(): int {
return $this->updated;
}
public function getUpdatedAt(): DateTime {
return DateTime::fromUnixTimeSeconds($this->updated);
}
}