forked from flashii/eeprom
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
namespace EEPROM\Users;
|
|
|
|
use Index\DateTime;
|
|
use Index\Data\IDbResult;
|
|
|
|
class UserInfo {
|
|
private string $id;
|
|
private int $created;
|
|
private ?int $restricted;
|
|
private int $sizeMultiplier;
|
|
|
|
public function __construct(IDbResult $result) {
|
|
$this->id = $result->getString(0);
|
|
$this->created = $result->getInteger(1);
|
|
$this->restricted = $result->getIntegerOrNull(2);
|
|
$this->sizeMultiplier = $result->getInteger(3);
|
|
}
|
|
|
|
public function getId(): string {
|
|
return $this->id;
|
|
}
|
|
|
|
public function getCreatedTime(): int {
|
|
return $this->created;
|
|
}
|
|
|
|
public function getCreatedAt(): DateTime {
|
|
return DateTime::fromUnixTimeSeconds($this->created);
|
|
}
|
|
|
|
public function isRestricted(): bool {
|
|
return $this->restricted !== null;
|
|
}
|
|
|
|
public function getRestrictedTime(): ?int {
|
|
return $this->restricted;
|
|
}
|
|
|
|
public function getRestrictedAt(): ?DateTime {
|
|
return $this->restricted === null ? null : DateTime::fromUnixTimeSeconds($this->restricted);
|
|
}
|
|
|
|
public function getDataSizeMultiplier(): int {
|
|
return $this->sizeMultiplier;
|
|
}
|
|
}
|