Update search-results-controller.php
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
if (session_status() === PHP_SESSION_NONE) {
|
if (session_status() === PHP_SESSION_NONE) {
|
||||||
session_start();
|
session_start();
|
||||||
}
|
}
|
||||||
require_once '../model/LocalArticleManager.php';
|
|
||||||
require_once '../model/ArticleManager.php';
|
require_once '../model/ArticleManager.php';
|
||||||
|
require_once '../model/UserManager.php';
|
||||||
require_once '../model/Article.php';
|
require_once '../model/Article.php';
|
||||||
require_once '../validator/search-validator.php';
|
require_once '../validator/search-validator.php';
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@ if ($_SERVER["REQUEST_METHOD"] === "GET" && isset($_GET["q"])) {
|
|||||||
try {
|
try {
|
||||||
|
|
||||||
$articleManager = ArticleManager::getInstance();
|
$articleManager = ArticleManager::getInstance();
|
||||||
|
$userManager = UserManager::getInstance();
|
||||||
|
|
||||||
$results = $articleManager->search($search);
|
$results = $articleManager->search($search);
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ if ($_SERVER["REQUEST_METHOD"] === "GET" && isset($_GET["q"])) {
|
|||||||
"id" => $obj->getId(),
|
"id" => $obj->getId(),
|
||||||
"title" => $obj->getTitle(),
|
"title" => $obj->getTitle(),
|
||||||
"content" => $obj->getContent(),
|
"content" => $obj->getContent(),
|
||||||
"author" => $obj->getAuthor(),
|
"author" => $userManager->findUser($obj->getAuthor())["vorname"] . " " . $userManager->findUser($obj->getAuthor())["nachname"],
|
||||||
"category" => $obj->getCategory(),
|
"category" => $obj->getCategory(),
|
||||||
"tags" => $obj->getTags(),
|
"tags" => $obj->getTags(),
|
||||||
"creationDate" => $obj->getCreationDate(),
|
"creationDate" => $obj->getCreationDate(),
|
||||||
|
|||||||
Reference in New Issue
Block a user