|
@@ -62,4 +62,13 @@ class Article {
|
|
|
public function setTitle(string $title): void {
|
|
public function setTitle(string $title): void {
|
|
|
$this->title = $title;
|
|
$this->title = $title;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ function jsonSerialize(): mixed {
|
|
|
|
|
+ return [
|
|
|
|
|
+ 'id' => $this->id,
|
|
|
|
|
+ 'title' => $this->title,
|
|
|
|
|
+ 'categoryName' => $this->categoryName,
|
|
|
|
|
+ 'text' => $this->text
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|