id; } public function getAuthor(): ?User { return $this->author; } public function setAuthor(?User $author): static { $this->author = $author; return $this; } public function getRelatedPost(): ?Post { return $this->related_post; } public function setRelatedPost(?Post $related_post): static { $this->related_post = $related_post; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->created_at; } public function setCreatedAt(\DateTimeImmutable $created_at): static { $this->created_at = $created_at; return $this; } public function getEditedAt(): ?\DateTimeImmutable { return $this->edited_at; } public function setEditedAt(\DateTimeImmutable $edited_at): static { $this->edited_at = $edited_at; return $this; } public function getContent(): ?string { return $this->content; } public function setContent(string $content): static { $this->content = $content; return $this; } #[ORM\PrePersist] public function setCreatedAtDate(): void { if ($this->created_at === null) { $this->created_at = new \DateTimeImmutable(); $this->edited_at = $this->created_at; } } #[ORM\PreUpdate] public function setEditedAtDate(): void { $this->edited_at = new \DateTimeImmutable(); } }