dev auf main #68

Open
niklas.ortmann wants to merge 1044 commits from devNachCSRF into main
Showing only changes of commit ea409dae07 - Show all commits
+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;
}
}
?>