31 lines
721 B
PHP
31 lines
721 B
PHP
<?php
|
|
namespace Hanyuu\Users\Db;
|
|
|
|
use Index\DateTime;
|
|
use Index\Data\IDbResult;
|
|
use Hanyuu\Users\IUserAuthInfo;
|
|
|
|
class DbUserAuthInfo implements IUserAuthInfo {
|
|
private string $userId;
|
|
private string $type;
|
|
private DateTime $enabled;
|
|
|
|
public function __construct(IDbResult $result) {
|
|
$this->userId = $result->getString(0);
|
|
$this->type = $result->getString(1);
|
|
$this->enabled = DateTime::fromUnixTimeSeconds($result->getInteger(2));
|
|
}
|
|
|
|
public function getUserId(): string {
|
|
return $this->userId;
|
|
}
|
|
|
|
public function getType(): string {
|
|
return $this->type;
|
|
}
|
|
|
|
public function getEnabledTime(): DateTime {
|
|
return $this->enabled;
|
|
}
|
|
}
|