Update LocalArticleManager.php
This commit is contained in:
@@ -36,14 +36,19 @@ class LocalArticleManager implements ArticleManagerDAO {
|
|||||||
* Speichert alle Artikel/Beiträge in der Datei.
|
* Speichert alle Artikel/Beiträge in der Datei.
|
||||||
* @param $articles
|
* @param $articles
|
||||||
* @return void
|
* @return void
|
||||||
* TODO: Exceptions implementieren.
|
* @throws InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public function saveArticle($articles)
|
private function saveArticle($articles)
|
||||||
{
|
{
|
||||||
file_put_contents(
|
try{
|
||||||
$this->file,
|
file_put_contents(
|
||||||
json_encode($articles, JSON_PRETTY_PRINT)
|
$this->file,
|
||||||
);
|
json_encode($articles, JSON_PRETTY_PRINT)
|
||||||
|
);
|
||||||
|
}catch (Exception $e){
|
||||||
|
throw new InternalServerErrorException($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addArticle($title, $content, $author, $category, $tags)
|
public function addArticle($title, $content, $author, $category, $tags)
|
||||||
|
|||||||
Reference in New Issue
Block a user