$this->id, 'post' => $this->post ? "post" : "copy", 'text' => $this->text, 'from_id' => $this->from_id, 'owner_id' => $this->owner_id, 'date' => $this->getDate()->toIso8601String(), 'name' => $this->getSourceName(), '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 getFromId(): int { return $this->from_id; } public function getDate(): Carbon { return $this->date; } /** * @return string */ public function getOwnerId(): int { return $this->owner_id; } public function getSourceName(): string { return $this->source_name; } public function setId(int $id): void { $this->id = $id; } public function setText(string $text): void { $this->text = $text; } public function setFromId(int $from_id): void { $this->from_id = $from_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; } public function setSourceName(string $source_name): void { $this->source_name = $source_name; } }