48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
namespace Hanyuu\Users;
|
|
|
|
use Index\DateTime;
|
|
use Index\Data\IDbResult;
|
|
|
|
class UserEMailInfo {
|
|
private string $userId;
|
|
private string $address;
|
|
private DateTime $created;
|
|
private bool $isVerified;
|
|
private DateTime $verified;
|
|
private bool $isRecovery;
|
|
|
|
public function __construct(IDbResult $result) {
|
|
$this->userId = $result->getString(0);
|
|
$this->address = $result->getString(1);
|
|
$this->created = DateTime::fromUnixTimeSeconds($result->getInteger(2));
|
|
$this->isVerified = !$result->isNull(3);
|
|
$this->verified = DateTime::fromUnixTimeSeconds($result->isNull(3) ? 0 : $result->getInteger(3));
|
|
$this->isRecovery = $result->getInteger(4) !== 0;
|
|
}
|
|
|
|
public function getUserId(): string {
|
|
return $this->userId;
|
|
}
|
|
|
|
public function getAddress(): string {
|
|
return $this->address;
|
|
}
|
|
|
|
public function getCreatedTime(): DateTime {
|
|
return $this->created;
|
|
}
|
|
|
|
public function isVerified(): bool {
|
|
return $this->isVerified;
|
|
}
|
|
|
|
public function getVerifiedTime(): DateTime {
|
|
return $this->verified;
|
|
}
|
|
|
|
public function isRecovery(): bool {
|
|
return $this->isRecovery;
|
|
}
|
|
}
|