Update ArticleManager.php
This commit is contained in:
@@ -45,25 +45,4 @@ class ArticleManager extends LocalArticleManager
|
|||||||
return $articleManager;
|
return $articleManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user