getString(0), name: $result->getString(1), ownerId: $result->getStringOrNull(2), created: $result->getInteger(3), locked: $result->getIntegerOrNull(4), comments: $result->getInteger(5), ); } public function getId(): string { return $this->id; } public function getName(): string { return $this->name; } public function hasOwnerId(): bool { return $this->ownerId !== null; } public function getOwnerId(): ?string { return $this->ownerId; } public function isOwner(UserInfo|string $user): bool { if($this->ownerId === null) return false; if($user instanceof UserInfo) $user = $user->getId(); return $user === $this->ownerId; } public function getCreatedTime(): int { return $this->created; } public function getCreatedAt(): DateTime { return DateTime::fromUnixTimeSeconds($this->created); } public function getLockedTime(): ?int { return $this->locked; } public function getLockedAt(): ?DateTime { return $this->locked === null ? null : DateTime::fromUnixTimeSeconds($this->locked); } public function isLocked(): bool { return $this->locked !== null; } public function getCommentsCount(): int { return $this->comments; } }