|
@@ -45,17 +45,17 @@ class ArticleController extends ControllerAdapter {
|
|
|
* @throws PageNotFoundException if Article could not be found.
|
|
* @throws PageNotFoundException if Article could not be found.
|
|
|
*/
|
|
*/
|
|
|
function getDoArticle(int $articleId): void {
|
|
function getDoArticle(int $articleId): void {
|
|
|
-// $out = array($articleId=>$this->articleDao->getArticleById($articleId));
|
|
|
|
|
-// if (in_array(null, $out, true)) {
|
|
|
|
|
-// throw new PageNotFoundException();
|
|
|
|
|
-// }
|
|
|
|
|
-// $this->sendJson($out);
|
|
|
|
|
-
|
|
|
|
|
- $article = $this->articleDao->getArticleById($articleId);
|
|
|
|
|
- if ($article === null) {
|
|
|
|
|
|
|
+ $out = array($articleId=>$this->articleDao->getArticleById($articleId));
|
|
|
|
|
+ if (in_array(null, $out, true)) {
|
|
|
throw new PageNotFoundException();
|
|
throw new PageNotFoundException();
|
|
|
}
|
|
}
|
|
|
- $this->sendJson($article);
|
|
|
|
|
|
|
+ $this->sendJson($out);
|
|
|
|
|
+
|
|
|
|
|
+// $article = $this->articleDao->getArticleById($articleId);
|
|
|
|
|
+// if ($article === null) {
|
|
|
|
|
+// throw new PageNotFoundException();
|
|
|
|
|
+// }
|
|
|
|
|
+// $this->sendJson($article);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|