From 30bb0d4657df3f0caf407155ffe498a52ad9ab5f Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Fri, 29 May 2026 09:32:56 +0200 Subject: [PATCH] getArticle by id --- php/model/LocalArticleManager.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/php/model/LocalArticleManager.php b/php/model/LocalArticleManager.php index e070b12..fe69b11 100644 --- a/php/model/LocalArticleManager.php +++ b/php/model/LocalArticleManager.php @@ -67,7 +67,15 @@ class LocalArticleManager implements ArticleManagerDAO { public function getArticle($id) { - // TODO: Implement getArticle() method. + $articles = $this->getAllArticles(); + + foreach ($articles as $article) { + if (isset($article['id']) && $article['id'] == $id) { + return $article; + } + } + + return null; } public function getAllArticles()