$value) { if (property_exists($this, $key)) { if ($key === 'date' && is_string($value)) { $this->date = new DateTimeImmutable($value); } else { $this->{$key} = $value; } } } } public function getId(): int { return $this->id; } public function setId(int $value): void { $this->id = $value; } public function getDate(): DateTimeImmutable { return $this->date; } public function setDate(DateTimeImmutable $value): void { $this->date = $value; } public function getVote(): string { return $this->vote; } public function setVote(string $value): void { $this->vote = $value; } }