$this->id, 'post' => (int) $this->post, 'text' => $this->text, 'author_id' => $this->author_id, 'owner_id' => $this->owner_id, 'date' => $this->getDate()->toIso8601String(), 'attachments' => $this->attachments, ]; } public function isEmpty(): bool { return empty($this->text); } public function isPost(): bool { return $this->post; } public function isRepost(): bool { return ! $this->post; } public function setIsPost(): void { $this->post = true; } public function setIsRepost(): void { $this->post = false; } public function getId(): int { return $this->id; } public function getText(): string { return $this->text; } public function getAuthorId(): int { return $this->author_id; } public function getDate(): Carbon { return $this->date; } /** * @return string */ public function getOwnerId(): int { return $this->owner_id; } public function setId(int $id): void { $this->id = $id; } public function setText(string $text): void { $this->text = $text; } public function setAuthorId(int $author_id): void { $this->author_id = $author_id; } public function setDate(string|int $date): void { $this->date = Carbon::parse($date); } public function setOwnerId(int $owner_id): void { $this->owner_id = $owner_id; } public function setAttachments(array $attachments = []): void { $this->attachments = $attachments; } }