private function getRecord(Request $request) { try { $query = self::getQueryValues($request); if (!array_key_exists('identifier', $query) || !array_key_exists('metadataprefix', $query)) { throw new OaiError('not enough parameters"', self::ERROR_BAD_ARGUMENT); } if ($query['metadataprefix'] != self::getCommonValues($request)['metadataPrefix']) { throw new OaiError("Incorrect metadataPrefix parameter", self::ERROR_BAD_ARGUMENT); } $articleId = self::getArticleId($query['identifier'], $request); $articles = ArticleDao::findContentById($articleId); $articles = ArticleService::getEnrichedArticles($articles); $article = DaoUtil::returnSingleElement($articles); self::enrichArticle($article); $values = self::getCommonValues($request); $values['article'] = $article; return Response::view('oai.record', $values)->header('Content-Type', 'application/xml'); } catch (OaiError $e) { return self::getErrorPage($request, self::$ERROR_CODES[$e->getCode()], $e->getMessage()); } }
static function findById($id) { $article = DB::table('article')->where('article_id', $id)->get(); return DaoUtil::returnSingleElement($article); }
static function findById($id) { $topic = DB::table('topic')->where('topic_id', $id)->get(); return DaoUtil::returnSingleElement($topic); }
static function findById($id) { $edition = DB::table('journal_edition')->where('journal_edition_id', $id)->get(); return DaoUtil::returnSingleElement($edition); }
static function findByPrefix($prefix) { $journal = DB::table('journal')->where('prefix', $prefix)->get(); return DaoUtil::returnSingleElement($journal); }
static function findById($id) { $author = DB::table('author')->where('author_id', $id)->get(); return DaoUtil::returnSingleElement($author); }