Kategorien nicht statisch sondern dynamisch #20

Merged
niklas.ortmann merged 21 commits from dynamicCategories into dev 2026-06-03 20:15:16 +02:00
Showing only changes of commit e35d07ebc3 - Show all commits
+21
View File
@@ -200,6 +200,27 @@ class LocalArticleManager implements ArticleManagerDAO {
return $filteredArticles;
}
public function getArticlesByCategory($category)
{
$articles = $this->getAllArticles();
$filteredArticles = [];
foreach ($articles as $article) {
if (isset($article['category']) && $article['category'] == $category) {
$filteredArticles[] = new Article(
intval($article['id']),
$article['title'],
$article['content'],
$article['author'],
$article['category'],
$article['tags'],
$article['creationDate']
);
}
}
return $filteredArticles;
}
}
?>