From e5b617dcba0450c149ad88988ea23f5e843d1a5a Mon Sep 17 00:00:00 2001 From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com> Date: Wed, 27 May 2026 19:31:38 +0200 Subject: [PATCH] testing --- php/controller/createArticle-controller.php | 12 +----------- php/model/ArticleManagerDAO.php | 4 ++-- php/model/LocalArticleManager.php | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/php/controller/createArticle-controller.php b/php/controller/createArticle-controller.php index 0ff5a04..7d1f582 100644 --- a/php/controller/createArticle-controller.php +++ b/php/controller/createArticle-controller.php @@ -20,17 +20,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { $author = "max.mustermann"; // TODO: später aus Session den angemeldeten Nutzer beziehen. $tags = $_POST["tags"]; - //$articleManager->addArticle($title, $content, $author, $category, $tags); - $articles[] = [ - //"id" => count($articles)+1, - "title" => $title, - "content" => $content, - "author" => $author, - "category" => $category, - "tags" => $tags, - //"creationDate" => date("Y-m-d H:i:s") - ]; - $articleManager->saveArticle($articles); + $articleManager->addArticle($title, $content, $author, $category, $tags); foreach ($articleManager->getAllArticles() as $article) { echo htmlspecialchars($article['title'])."
"; diff --git a/php/model/ArticleManagerDAO.php b/php/model/ArticleManagerDAO.php index ac01ce4..2f2ffd8 100644 --- a/php/model/ArticleManagerDAO.php +++ b/php/model/ArticleManagerDAO.php @@ -12,12 +12,12 @@ interface ArticleManagerDAO * @param $content string Inhalt des Beitrags * @param $author string der Autor des des Beitrages NID * @param $category string Kategorie des Beitrages - * @param $tags string[] optionale Schlagworte für eine bessere Suche + * @param $tags string optionale Schlagworte für eine bessere Suche * * Mögliche Exceptions: * TODO Fehlerbeschreibung hinzufügen & tags hinzufügen */ - public function addArticle($title, $content, $author, $category, array $tags); + public function addArticle($title, $content, $author, $category, $tags); /* * Ein angemeldeter Nutzer bearbeitet einen Beitrag. diff --git a/php/model/LocalArticleManager.php b/php/model/LocalArticleManager.php index cf47d14..617d3d9 100644 --- a/php/model/LocalArticleManager.php +++ b/php/model/LocalArticleManager.php @@ -38,7 +38,7 @@ class LocalArticleManager implements ArticleManagerDAO { ); } - public function addArticle($title, $content, $author, $category, array $tags) + public function addArticle($title, $content, $author, $category, $tags) { $articles = $this->getAllArticles();