Update LocalArticleManager.php

This commit is contained in:
NOrtmann1
2026-05-29 17:20:07 +02:00
parent 2810bfdce2
commit ea409dae07
+20
View File
@@ -97,5 +97,25 @@ class LocalArticleManager implements ArticleManagerDAO {
return is_array($articles) ? $articles : [];
}
public function getArticlesByAuthor($author)
{
$articles = $this->getAllArticles();
$filteredArticles = [];
foreach ($articles as $article) {
if (isset($article['author']) && $article['author'] == $author) {
$filteredArticles[] = new Article(
intval($article['id']),
$article['title'],
$article['content'],
$article['author'],
$article['category'],
$article['tags'],
$article['creationDate']
);
}
}
return $filteredArticles;
}
}
?>