$this->id, 'client_id' => $this->clientId, 'sender' => $this->sender, 'recipients' => $this->recipients, 'subject' => $this->subject, 'content_html' => Tools::sanitizeContent($this->contentHtml ?? ''), 'content_text' => $this->contentText, 'has_attachment' => $this->attachmentName !== null, 'created_at' => $this->getCreatedAt()?->format('Y-m-d H:i:s'), 'updated_at' => $this->getUpdatedAt()?->format('Y-m-d H:i:s'), ]; } public function getId(): ?int { return $this->id; } public function getClientId(): ?int { return $this->clientId; } public function setClientId(?int $clientId): self { $this->clientId = $clientId; return $this; } public function getSender(): ?string { return $this->sender; } public function setSender(?string $sender): self { $this->sender = $sender; return $this; } public function getRecipients(): ?string { return $this->recipients; } public function setRecipients(?string $recipients): self { $this->recipients = $recipients; return $this; } public function getSubject(): ?string { return $this->subject; } public function setSubject(?string $subject): self { $this->subject = $subject; return $this; } public function getContentHtml(): ?string { return $this->contentHtml; } public function setContentHtml(?string $contentHtml): self { $this->contentHtml = $contentHtml; return $this; } public function getContentText(): ?string { return $this->contentText; } public function setContentText(?string $contentText): self { $this->contentText = $contentText; return $this; } public function getAttachmentName(): ?string { return $this->attachmentName; } public function setAttachmentName(?string $attachmentName): self { $this->attachmentName = $attachmentName; return $this; } public function getAttachmentContent(): ?string { if (is_resource($this->attachmentContent)) { return stream_get_contents($this->attachmentContent) ?: null; } return $this->attachmentContent; } public function setAttachmentContent(?string $attachmentContent): self { $this->attachmentContent = $attachmentContent; return $this; } public function getAttachmentMime(): ?string { return $this->attachmentMime; } public function setAttachmentMime(?string $attachmentMime): self { $this->attachmentMime = $attachmentMime; return $this; } }