From 8e4a147341eb525455e69ec7316daa5e011ae823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Lahmann?= <lahmann@ub.uni-leipzig.de> Date: Wed, 23 Nov 2016 13:53:31 +0100 Subject: [PATCH] refs #9172: * changed code to comply with strict code standard --- module/finc/src/finc/RecordDriver/SolrAI.php | 16 +++++++++++----- .../src/finc/RecordDriver/SolrMarcFincPDA.php | 6 ++---- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/module/finc/src/finc/RecordDriver/SolrAI.php b/module/finc/src/finc/RecordDriver/SolrAI.php index 47934e336c1..c21b5f87d9e 100644 --- a/module/finc/src/finc/RecordDriver/SolrAI.php +++ b/module/finc/src/finc/RecordDriver/SolrAI.php @@ -28,8 +28,7 @@ * @link http://vufind.org/wiki/vufind2:record_drivers Wiki */ namespace finc\RecordDriver; -use \VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface, - Zend\Log\LoggerAwareInterface as LoggerAwareInterface; +use \VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface; /** * Recorddriver for Solr records from the aggregated index of Leipzig University @@ -44,10 +43,9 @@ use \VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface, * @SuppressWarnings(PHPMD.ExcessivePublicCount) */ class SolrAI extends SolrDefault implements - HttpServiceAwareInterface, LoggerAwareInterface + HttpServiceAwareInterface { use \VuFindHttp\HttpServiceAwareTrait; - use \VuFind\Log\LoggerAwareTrait; /** * AI record @@ -375,10 +373,18 @@ class SolrAI extends SolrDefault implements * Get the OpenURL parameters to represent this record (useful for the * title attribute of a COinS span tag). * + * @param bool $overrideSupportsOpenUrl Flag to override checking + * supportsOpenUrl() (default is false) + * * @return string OpenURL parameters. */ - public function getOpenURL() + public function getOpenUrl($overrideSupportsOpenUrl = false) { + // stop here if this record does not support OpenURLs + if (!$overrideSupportsOpenUrl && !$this->supportsOpenUrl()) { + return false; + } + $genre = $this->getAIRecord('rft.genre'); // Set up parameters based on the format of the record: switch ($genre) { diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php b/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php index eba0f0b63b6..940c90c7869 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php @@ -29,8 +29,7 @@ */ namespace finc\RecordDriver; -use VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface, - Zend\Log\LoggerAwareInterface as LoggerAwareInterface; +use VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface; /** * Model for PDA MARC records in Solr. @@ -43,10 +42,9 @@ use VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface, * @link http://vufind.org/wiki/vufind2:record_drivers Wiki */ class SolrMarcFincPDA extends SolrMarcFinc implements - HttpServiceAwareInterface, LoggerAwareInterface + HttpServiceAwareInterface { use \VuFindHttp\HttpServiceAwareTrait; - use \VuFind\Log\LoggerAwareTrait; /** * Get the price in Euro for the record. -- GitLab