getString(0), name: $result->getString(1), passwordHash: $result->getStringOrNull(2), emailAddress: $result->getString(3), registerRemoteAddress: $result->getString(4), lastRemoteAddress: $result->getStringOrNull(5), super: $result->getBoolean(6), countryCode: $result->getString(7), colourRaw: $result->getIntegerOrNull(8), createdTime: $result->getInteger(9), lastActiveTime: $result->getIntegerOrNull(10), deletedTime: $result->getIntegerOrNull(11), displayRoleId: $result->getStringOrNull(12), totpKey: $result->getStringOrNull(13), aboutBody: $result->getStringOrNull(14), aboutBodyParser: $result->getInteger(15), signatureBody: $result->getStringOrNull(16), signatureBodyParser: $result->getInteger(17), birthdateRaw: $result->getStringOrNull(18), backgroundSettings: $result->getIntegerOrNull(19), title: $result->getString(20), ); } public bool $hasPasswordHash { get => $this->passwordHash !== null && $this->passwordHash !== ''; } public bool $passwordNeedsRehash { get => $this->hasPasswordHash && Users::passwordNeedsRehash($this->passwordHash); } public function verifyPassword(string $password): bool { return $this->hasPasswordHash && password_verify($password, $this->passwordHash); } public bool $hasColour { get => $this->colourRaw !== null && ($this->colourRaw & 0x40000000) === 0; } public Colour $colour { get => $this->colourRaw === null ? Colour::none() : Colour::fromMisuzu($this->colourRaw); } public CarbonImmutable $createdAt { get => CarbonImmutable::createFromTimestampUTC($this->createdTime); } public ?CarbonImmutable $lastActiveAt { get => $this->lastActiveTime === null ? null : CarbonImmutable::createFromTimestampUTC($this->lastActiveTime); } public bool $deleted { get => $this->deletedTime !== null; } public ?CarbonImmutable $deletedAt { get => $this->deletedTime === null ? null : CarbonImmutable::createFromTimestampUTC($this->deletedTime); } public bool $hasTOTP { get => $this->totpKey !== null; } public bool $isAboutBodyPlain { get => $this->aboutBodyParser === Parser::PLAIN; } public bool $isAboutBodyBBCode { get => $this->aboutBodyParser === Parser::BBCODE; } public bool $isAboutBodyMarkdown { get => $this->aboutBodyParser === Parser::MARKDOWN; } public bool $isSignatureBodyPlain { get => $this->signatureBodyParser === Parser::PLAIN; } public bool $isSignatureBodyBBCode { get => $this->signatureBodyParser === Parser::BBCODE; } public bool $isSignatureBodyMarkdown { get => $this->signatureBodyParser === Parser::MARKDOWN; } public bool $hasBirthdate { get => $this->birthdateRaw !== null; } public ?CarbonImmutable $birthdate { get => $this->birthdateRaw === null ? null : CarbonImmutable::createFromFormat('Y-m-d', $this->birthdateRaw, 'UTC'); } public int $age { get { $birthdate = $this->birthdate; if($birthdate === null || (int)$birthdate->format('Y') < 1900) return -1; return (int)$birthdate->diff(CarbonImmutable::now())->format('%y'); } } }