$value) { if (property_exists($this, $key)) { $this->{$key} = $value; } } } public function toArray(): array { return [ 'uid' => $this->uid, 'title' => $this->title, 'content' => $this->content, ]; } }