id = (string)$result->getInteger($args); $this->categoryId = (string)$result->getInteger(++$args); $this->userId = $result->isNull(++$args) ? null : (string)$result->getInteger($args); $this->replyingTo = $result->isNull(++$args) ? null : (string)$result->getInteger($args); $this->body = $result->getString(++$args); $this->created = $result->getInteger(++$args); $this->pinned = $result->isNull(++$args) ? null : $result->getInteger($args); $this->updated = $result->isNull(++$args) ? null : $result->getInteger($args); $this->deleted = $result->isNull(++$args) ? null : $result->getInteger($args); $this->replies = $includeRepliesCount ? $result->getInteger(++$args) : 0; if($includeVotesCount) { $this->votesTotal = $result->getInteger(++$args); $this->votesPositive = $result->getInteger(++$args); $this->votesNegative = $result->getInteger(++$args); } else { $this->votesTotal = 0; $this->votesPositive = 0; $this->votesNegative = 0; } } public function getId(): string { return $this->id; } public function getCategoryId(): string { return $this->categoryId; } public function hasUserId(): bool { return $this->userId !== null; } public function getUserId(): ?string { return $this->userId; } public function isReply(): bool { return $this->replyingTo !== null; } public function getReplyingTo(): ?string { return $this->replyingTo; } public function getBody(): string { return $this->body; } public function getCreatedTime(): int { return $this->created; } public function getCreatedAt(): DateTime { return DateTime::fromUnixTimeSeconds($this->created); } public function getPinnedTime(): ?int { return $this->pinned; } public function getPinnedAt(): DateTime { return $this->pinned === null ? null : DateTime::fromUnixTimeSeconds($this->pinned); } public function isPinned(): bool { return $this->pinned !== null; } public function getUpdatedTime(): ?int { return $this->updated; } public function getUpdatedAt(): DateTime { return $this->updated === null ? null : DateTime::fromUnixTimeSeconds($this->updated); } public function isEdited(): bool { return $this->updated !== null; } public function getDeletedTime(): ?int { return $this->deleted; } public function getDeletedAt(): DateTime { return $this->deleted === null ? null : DateTime::fromUnixTimeSeconds($this->deleted); } public function isDeleted(): bool { return $this->deleted !== null; } public function hasRepliesCount(): bool { return $this->replies > 0; } public function getRepliesCount(): int { return $this->replies; } public function hasVotesCount(): bool { return $this->votesTotal > 0; } public function getVotesTotal(): int { return $this->votesTotal; } public function getVotesPositive(): int { return $this->votesPositive; } public function getVotesNegative(): int { return $this->votesNegative; } }