From da6ac3d913c801e4dd8350e56a1594e778c58b92 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Mon, 5 Oct 2015 15:30:23 -0400 Subject: [PATCH] Added Solr DOI support. --- .../VuFind/src/VuFind/RecordDriver/SolrDefault.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php index c910f4f4267..f216d78193e 100644 --- a/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php +++ b/module/VuFind/src/VuFind/RecordDriver/SolrDefault.php @@ -296,6 +296,19 @@ class SolrDefault extends AbstractBase return isset($this->fields['callnumber-raw']) ? $this->fields['callnumber-raw'] : []; } + + /** + * Return the first valid DOI found in the record (false if none). + * + * @return mixed + */ + public function getCleanDOI() + { + $field = 'doi_str_mv'; + return (isset($this->fields[$field][0]) && !empty($this->fields[$field][0])) + ? $this->fields[$field][0] : false; + } + /** * Return the first valid ISBN found in the record (favoring ISBN-10 over * ISBN-13 when possible). -- GitLab