setCreatedAt( new DateTime() ); } public function setCreatedAt( DateTimeInterface $createdAt ): self { $this->createdAt = $createdAt; return $this; } public function getCreatedAt(): ?DateTimeInterface { return $this->createdAt; } function display() { return [ 'id' => $this->getId(), 'text' => $this->getText(), 'pseudo' => $this->getOwner()->getPseudo(), 'created_at' => $this->getCreatedAtAsString(), ]; } public function getId(): ?int { return $this->id; } public function getText(): ?string { return $this->text; } public function setText( string $text ): self { $this->text = $text; return $this; } public function getOwner(): ?Owner { return $this->owner; } public function setOwner( ?Owner $owner ): self { $this->owner = $owner; return $this; } public function getPoll(): ?Poll { return $this->poll; } public function setPoll( ?Poll $poll ): self { $this->poll = $poll; return $this; } public function getPseudo(): ?string { return $this->pseudo; } public function setPseudo( string $pseudo ): self { $this->pseudo = $pseudo; return $this; } }