refactoring

This commit is contained in:
NOrtmann1
2026-05-26 18:55:42 +02:00
parent d7acca36fd
commit e128a31a34
4 changed files with 39 additions and 22 deletions
+8 -7
View File
@@ -7,7 +7,8 @@ require_once 'ArticleManagerDAO.php';
* @author Niklas Ortmann
*/
class ArticleManager implements ArticleManagerDAO {
/*
/**
* Gibt die Datenbank-Instanz zurück.
*/
public static function getInstance()
@@ -29,13 +30,13 @@ class ArticleManager implements ArticleManagerDAO {
}
public function newArticle($title, $content, $author, $category) {
public function newArticle($article) {
$newData = array(
"title" => $title,
"content" => $content,
"author" => $author,
"category" => $category,
//"tags" => isset($_POST["tags"]) ? $_POST["tags"] : '', TODO: Später hinzufügen
"title" => $article->getTitle(),
"content" => $article->getContent(),
"author" => $article->getAuthor(),
"category" => $article->getCategory(),
//"tags" => $article->getTags(), TODO: Später hinzufügen
"date" => date("d.m.Y, H:i")
);
$newData = base64_encode(serialize($newData));