public function show($authorId) { try { $author = AuthorDao::findById($authorId); } catch (NoElementException $e) { App::abort(404, 'Author not found'); } $articles = ArticleDao::findByAuthor($authorId); $articles = ArticleService::getEnrichedArticles($articles); return view('author.details')->with(array('author' => $author, 'articles' => $articles)); }
private static function saveAuthor($author) { $authorId = AuthorDao::persist($author); return AuthorDao::findById($authorId); }