diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index 0d2d75d3d67f26258416a8f8874e5107e9b3b880..31b918110ee4f57b3270a454c0a432382ec3e66b 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -46,7 +46,6 @@ trait SolrMarcFincTrait * Returns true if the record supports real-time AJAX status lookups. * * @return bool - * @access public */ public function supportsAjaxStatus() { @@ -58,7 +57,6 @@ trait SolrMarcFincTrait * in 040$e) * * @return bool - * @access public */ public function isRDA() { @@ -98,7 +96,6 @@ trait SolrMarcFincTrait $indicator1 = $url->getIndicator('1'); $indicator2 = $url->getIndicator('2'); - $isISIL = false; if ($isil) { @@ -164,14 +161,12 @@ trait SolrMarcFincTrait return $retVal; } - /** * Return a description about volumes in stock via consortial field * with subfield $h. * Currently only used in DE-L152. * * @return array - * @access public */ public function getVolumesInStock() { @@ -185,7 +180,6 @@ trait SolrMarcFincTrait * Currently only used in DE-L152. * * @return array - * @access public */ public function getVolumesCommentInStock() { @@ -231,7 +225,6 @@ trait SolrMarcFincTrait * LocalMarcFieldOfLibrary $m * * @return null|string - * @access public */ public function getLocalOrderInformation() { @@ -263,7 +256,6 @@ trait SolrMarcFincTrait * university library of Freiberg at finc marc 972i. * * @return string - * @access protected */ protected function getLocalGivenCallnumber() { @@ -280,7 +272,6 @@ trait SolrMarcFincTrait * Get an array of supplements and special issue entry. * * @return array - * @access public * @link http://www.loc.gov/marc/bibliographic/bd770.html */ public function getSupplements() @@ -315,7 +306,6 @@ trait SolrMarcFincTrait * field 024 indicator 8 subfield $a. Refs #1442 * * @return array - * @access public */ public function getIndexOfGermanPrints() { @@ -331,10 +321,10 @@ trait SolrMarcFincTrait } foreach ($fields as $field) { // ->getIndicator(position) - if (in_array($field->getIndicator('1'),$lookfor_indicators)) { + if (in_array($field->getIndicator('1'), $lookfor_indicators)) { if ($subfield = $field->getSubfield('a')) { $data = $subfield->getData(); - if (stripos($data,'VD') === 0) { + if (stripos($data, 'VD') === 0) { $retval[] = $data; } } @@ -343,12 +333,10 @@ trait SolrMarcFincTrait return $retval; } - /** * Method reading MARC field 24 * * @return array - * @access public */ public function getOtherIdentifiers() { @@ -374,7 +362,6 @@ trait SolrMarcFincTrait * of the Petrucci music library subfield 590b * * @return array - * @access public */ public function getInstrumentation() { @@ -385,7 +372,6 @@ trait SolrMarcFincTrait * Get the ISSN from a record. Refs #969 * * @return array - * @access public */ public function getISSNs() { @@ -396,7 +382,6 @@ trait SolrMarcFincTrait * Get the ISSN from a the parallel title of a record. Refs #969 * * @return array - * @access public */ public function getISSNsParallelTitles() { @@ -575,7 +560,6 @@ trait SolrMarcFincTrait * subfield t and (if present) subfield r. * * @return array - * @access public */ public function getWorkPartTitleDetails() { @@ -588,7 +572,7 @@ trait SolrMarcFincTrait #return preg_replace( # $titleRegexPattern, '', trim($string) #); - return rtrim($string, " \t\n\r\0\x0B".'.:-/'); + return rtrim($string, " \t\n\r\0\x0B" . '.:-/'); }; if ($fields = $this->getMarcRecord()->getFields('505')) { @@ -618,14 +602,13 @@ trait SolrMarcFincTrait * from MARC field 700. * * @return array - * @access public */ public function getWorkTitleDetails() { $workTitles = []; $truncateTrail = function ($string) { - return rtrim($string, " \t\n\r\0\x0B".'.:-/'); + return rtrim($string, " \t\n\r\0\x0B" . '.:-/'); }; if ($fields = $this->getMarcRecord()->getFields('700')) { @@ -729,7 +712,6 @@ trait SolrMarcFincTrait * Refs #328 * * @return array - * @access public */ public function getJournalHoldings() { @@ -762,9 +744,9 @@ trait SolrMarcFincTrait } $retval[$key]['link'] = '/Record/' . $this->getUniqueID() - .'/HoldJournalCHE?callnumber=' + . '/HoldJournalCHE?callnumber=' . urlencode($retval[$key]['callnumber']) - .'&barcode=' . $barcode; + . '&barcode=' . $barcode; $key++; } } @@ -777,7 +759,6 @@ trait SolrMarcFincTrait * Seems to be very extraordinary special case. Refs #1302 * * @return array - * @access protected */ protected function getLocalAccessNumber() { @@ -789,14 +770,13 @@ trait SolrMarcFincTrait } return []; } - + /** * Return a local access number for call number. * Marc field depends on library e.g. 986 for GfzK. * Seems to be very extraordinary special case. Refs #7924 * * @return array - * @access public */ public function getLocalSubject() { @@ -842,7 +822,6 @@ trait SolrMarcFincTrait * Get all local class subjects. First realization for HGB. Refs #2626 * * @return array - * @access protected */ protected function getLocalClassSubjects() { @@ -865,14 +844,12 @@ trait SolrMarcFincTrait return $array; } - /** * Returning local format field of a library using an consortial defined * field with subfield $c. Marc field depends on library e.g. 970 for HMT or * 972 for TUBAF * * @return array - * @access public */ public function getLocalFormat() { @@ -895,7 +872,6 @@ trait SolrMarcFincTrait * settings in config.ini. Refs 7063 * * @return mixed - * @access protected */ protected function getLocalMarcFieldOfLibrary() { @@ -929,7 +905,6 @@ trait SolrMarcFincTrait * Refs #1308 * * @return array - * @access protected */ protected function getLocalNotice() { @@ -944,7 +919,6 @@ trait SolrMarcFincTrait * Marc field depends on library e.g. 986 for GFZK. Refs #8146 * * @return array - * @access public */ public function getLocalSignature() { @@ -968,7 +942,6 @@ trait SolrMarcFincTrait * subfield $h. Marc field depends on library e.g. 972 for TUF. * * @return array - * @access protected */ protected function getLocalStockSpecification() { @@ -986,7 +959,6 @@ trait SolrMarcFincTrait * at the marc field. * * @return mixed null if there's no field or array with results - * @access public */ public function getMusicHeading() { @@ -1015,7 +987,6 @@ trait SolrMarcFincTrait * getting previous title of marc field 780. * * @return array - * @access protected */ public function getNewerTitles() { @@ -1047,13 +1018,11 @@ trait SolrMarcFincTrait return $array; } - /** * Get notice of a title representing a special case of University * library of Chemnitz: MAB field 999l * * @return string - * @access protected */ protected function getNotice() { @@ -1067,7 +1036,6 @@ trait SolrMarcFincTrait * mentioned record in 787 $a{t}. * * @return array|null - * @access public */ public function getOtherRelationshipEntry() { @@ -1108,7 +1076,6 @@ trait SolrMarcFincTrait * of the Petrucci music library subfield 590a * * @return array - * @access public */ public function getPieceStyle() { @@ -1122,7 +1089,6 @@ trait SolrMarcFincTrait * @todo More flexible implementation * * @return array - * @access protected */ protected function getParallelEditions() { @@ -1159,7 +1125,6 @@ trait SolrMarcFincTrait * Get an array of previous titles for the record. * * @return array - * @access protected */ public function getPreviousTitles() { @@ -1187,7 +1152,7 @@ trait SolrMarcFincTrait $array[$key]['id'] = current($linkedRecords['first_results'])->getUniqueId(); } } // end foreach - + return $array; } @@ -1199,7 +1164,6 @@ trait SolrMarcFincTrait * @todo pass prices by euro currency * * @return string - * @access public */ public function getPrice() { @@ -1213,7 +1177,7 @@ trait SolrMarcFincTrait ['lhs','rhs','error','icc'], ['"lhs"','"rhs"','"error"','"icc"'], file_get_contents( - "http://www.google.com/ig/calculator?q=".$price.$currency."=?EUR" + "http://www.google.com/ig/calculator?q=" . $price . $currency . "=?EUR" ) ), true @@ -1224,7 +1188,7 @@ trait SolrMarcFincTrait return money_format('%.2n', $rhs[0]); } } - return $currency . " ". $price; + return $currency . " " . $price; } return ""; } @@ -1233,7 +1197,6 @@ trait SolrMarcFincTrait * Get the provenience of a title. * * @return array - * @access public */ public function getProvenience() { @@ -1246,7 +1209,6 @@ trait SolrMarcFincTrait * 972 for TUBAF * * @return bool - * @access protected */ protected function getPurchaseInformation() { @@ -1262,7 +1224,6 @@ trait SolrMarcFincTrait * Get a short list of series for ISBD citation style * * @return array - * @access protected * @link http://www.loc.gov/marc/bibliographic/bd830.html */ protected function getSeriesWithVolume() @@ -1274,7 +1235,6 @@ trait SolrMarcFincTrait * Get local classification of UDK. * * @return array - * @access protected * @deprecated Seems to be only for HTWK in use formerly? */ protected function getUDKs() @@ -1326,7 +1286,6 @@ trait SolrMarcFincTrait * Get addional entries for personal names. * * @return array - * @access protected * @link http://www.loc.gov/marc/bibliographic/bd700.html */ protected function getAdditionalAuthors() @@ -1357,7 +1316,6 @@ trait SolrMarcFincTrait * for UBL only implemented. Refs. #1315 * * @return array - * @access public */ public function getAdditionals() { @@ -1390,7 +1348,7 @@ trait SolrMarcFincTrait // only proceed if we actually have a value for the text if (count($text) > 0) { $array[$i] = [ - 'text' => implode(', ', $text), + 'text' => implode(', ', $text), 'identifier' => ($line->getSubfield('i')) ? $line->getSubfield('i')->getData() : '', 'note' => ($line->getSubfield('n')) @@ -1409,7 +1367,7 @@ trait SolrMarcFincTrait foreach ($linkFields as $current) { $linked[] = $current->getData(); } - $linkedRecords = $this->searchRelatedRecords('isbn',$linked, 1); + $linkedRecords = $this->searchRelatedRecords('isbn', $linked, 1); if (!empty($linkedRecords['first_results'])) { $array[$i]['related_records'] = $linkedRecords; } @@ -1423,7 +1381,7 @@ trait SolrMarcFincTrait foreach ($linkFields as $current) { $linked[] = $current->getData(); } - $linkedRecords = $this->searchRelatedRecords('isbn',$linked, 1); + $linkedRecords = $this->searchRelatedRecords('isbn', $linked, 1); if (!empty($linkedRecords['first_results'])) { $array[$i] = [ 'related_records' => $linkedRecords, @@ -1450,12 +1408,12 @@ trait SolrMarcFincTrait { $array = []; $fields = [ - '773' => ['a'=>['',': '], 't'=>['',''], 'g'=>[' ; ','']], - '490' => ['a'=>['','']], - '800' => ['a'=>['',': '], 't'=>['',''], 'v'=>[' ; ',''] ,'g'=>[' ; ','']], - '810' => ['a'=>['',': '], 't'=>['',''], 'v'=>[' ; ',''] ,'g'=>[' ; ','']], - '811' => ['a'=>['',': '], 't'=>['',''], 'v'=>[' ; ',''] ,'g'=>[' ; ','']], - '830' => ['a'=>['',''], 'v'=>[' ; ','']] + '773' => ['a' => ['',': '], 't' => ['',''], 'g' => [' ; ','']], + '490' => ['a' => ['','']], + '800' => ['a' => ['',': '], 't' => ['',''], 'v' => [' ; ',''],'g' => [' ; ','']], + '810' => ['a' => ['',': '], 't' => ['',''], 'v' => [' ; ',''],'g' => [' ; ','']], + '811' => ['a' => ['',': '], 't' => ['',''], 'v' => [' ; ',''],'g' => [' ; ','']], + '830' => ['a' => ['',''], 'v' => [' ; ','']] ]; $i = 0; @@ -1487,9 +1445,9 @@ trait SolrMarcFincTrait } elseif (empty($val)) { continue; } else { - $text[] = $l_delim.$val->getData().$r_delim; - if (in_array($subfield,['a','t'])) $label[] = $l_delim.$val->getData().$r_delim; - else $suffix[] = $l_delim.$val->getData().$r_delim; + $text[] = $l_delim . $val->getData() . $r_delim; + if (in_array($subfield, ['a','t'])) $label[] = $l_delim . $val->getData() . $r_delim; + else $suffix[] = $l_delim . $val->getData() . $r_delim; } } else { if (empty($val)) { @@ -1497,21 +1455,21 @@ trait SolrMarcFincTrait } if ($field == '490') { if ($line->getIndicator(1) == 0) { - $text[] = $l_delim.$val->getData().$r_delim; - if ($subfield === 'a') $label[] = $l_delim.$val->getData().$r_delim; - else $suffix[] = $l_delim.$val->getData().$r_delim; + $text[] = $l_delim . $val->getData() . $r_delim; + if ($subfield === 'a') $label[] = $l_delim . $val->getData() . $r_delim; + else $suffix[] = $l_delim . $val->getData() . $r_delim; } } elseif ($subfield == 'v' && in_array($field, ['800', '810', '811'])) { if (!empty($val)) { - $suffix[] = $text[] = $l_delim.$val->getData().$r_delim; + $suffix[] = $text[] = $l_delim . $val->getData() . $r_delim; // do not use the next (and last) subfield $g, // if $v is already set break; } } else { - $text[] = $l_delim.$val->getData().$r_delim; - if (in_array($subfield,['a','t'])) $label[] = $l_delim.$val->getData().$r_delim; - else $suffix[] = $l_delim.$val->getData().$r_delim; + $text[] = $l_delim . $val->getData() . $r_delim; + if (in_array($subfield, ['a','t'])) $label[] = $l_delim . $val->getData() . $r_delim; + else $suffix[] = $l_delim . $val->getData() . $r_delim; } } } @@ -1520,9 +1478,9 @@ trait SolrMarcFincTrait // only proceed if we actually have a value for the text if (count($text) > 0) { $array[$i] = [ - 'text' => implode('', $text), - 'label' => !empty($label) ? implode('',$label) : '', - 'suffix' => !empty($suffix) ? implode('',$suffix) : '', + 'text' => implode('', $text), + 'label' => !empty($label) ? implode('', $label) : '', + 'suffix' => !empty($suffix) ? implode('', $suffix) : '', 'identifier' => ($line->getSubfield('i')) ? $line->getSubfield('i')->getData() : 'Set Multipart' ]; @@ -1551,7 +1509,6 @@ trait SolrMarcFincTrait * Refs. #8509 * * @return array|null - * @access public */ public function getAdditionalNotes() { @@ -1574,13 +1531,12 @@ trait SolrMarcFincTrait * Returns all notes. * * @return array - * @access public */ public function getAllNotes() { $notes = array_merge( - (array) $this->getGeneralNotes(), - (array) $this->getAdditionalNotes() + (array)$this->getGeneralNotes(), + (array)$this->getAdditionalNotes() ); foreach ($notes as &$note) { if (preg_match('/(.*)\.\s*$/', $note, $matches)) { @@ -1595,7 +1551,6 @@ trait SolrMarcFincTrait * Refs #8369 * * @return array - * @access public */ public function getHierarchyParentID() { @@ -1617,7 +1572,7 @@ trait SolrMarcFincTrait if ($field->getSubfield('w')) { // refactored with #18333 $related = $this->getRelatedKxpRecord($field); - if (!empty( $related['first_results'] ?? [])) { + if (!empty($related['first_results'] ?? [])) { $parentID[] = current($related['first_results'])->getUniqueId(); } } elseif ($fieldNumber == '490') { @@ -1645,7 +1600,6 @@ trait SolrMarcFincTrait * Refs #8369 * * @return array - * @access public */ public function getHierarchyParentTitle() { @@ -1728,7 +1682,6 @@ trait SolrMarcFincTrait * the bsz heading subjects chains. * * @return array - * @access public */ public function getAllSubjectHeadingsExtended() { @@ -1740,7 +1693,7 @@ trait SolrMarcFincTrait foreach ($fields as $field) { $subjectrow = $field->getIndicator('1'); if ($subjectrow != $firstindicator) { - $key = (isset($key) ? $key +1 : 0); + $key = (isset($key) ? $key + 1 : 0); $firstindicator = $subjectrow; } // #5668 #5046 BSZ MARC may contain uppercase subfields but solrmarc set @@ -1770,7 +1723,6 @@ trait SolrMarcFincTrait * @param boolean $extended If dynamic index extension activated * * @return array - * @access public */ public function getAllSubjectHeadings($extended = false) { @@ -1845,15 +1797,14 @@ trait SolrMarcFincTrait * Check if Topics exists. Realized for instance of UBL only. * * @return boolean True if topics exist. - * @access public */ public function hasTopics() { $rvk = $this->getRvkWithMetadata(); - return ( + return parent::hasTopics() || (is_array($rvk) && count($rvk) > 0) - ); + ; } /** @@ -1861,7 +1812,6 @@ trait SolrMarcFincTrait * for UBL only implemented. * * @return array - * @access public */ public function getTopics() { @@ -1916,7 +1866,6 @@ trait SolrMarcFincTrait * for petrucci music library. * * @return array - * @access protected */ protected function getCatalogueNumber() { @@ -1927,7 +1876,6 @@ trait SolrMarcFincTrait * Get the volume number * * @return array - * @access protected */ protected function getVolume() { @@ -1939,7 +1887,6 @@ trait SolrMarcFincTrait * * @return array Return multidimensional array with key of 'coordinates' * and 'scale' - * @access public */ public function getCartographicData() { @@ -1966,7 +1913,6 @@ trait SolrMarcFincTrait * Get an array of content notes. * * @return array - * @access protected */ protected function getContentNote() { @@ -1977,7 +1923,6 @@ trait SolrMarcFincTrait * Get an array of included titles. * * @return array - * @access protected */ protected function getIncludedTitles() { @@ -1990,7 +1935,6 @@ trait SolrMarcFincTrait * Get dissertation notes for the record. * * @return array $retVal - * @access public */ public function getDissertationNote() { @@ -2015,7 +1959,6 @@ trait SolrMarcFincTrait * @param boolean $allow_multiple_results * * @return string|array - * @access protected */ protected function getRelatedItems($allow_multiple_results = false) { @@ -2027,7 +1970,7 @@ trait SolrMarcFincTrait } public function searchRelatedRecords($field, $values, $limit = 20, - $filters=[], $backend_id = 'Solr' + $filters = [], $backend_id = 'Solr' ) { if (!empty($filters)) { @@ -2078,7 +2021,6 @@ trait SolrMarcFincTrait * Get RVK classification number with metadata from Marc records. Refs #599 * * @return array - * @access public */ public function getRvkWithMetadata() { @@ -2119,7 +2061,6 @@ trait SolrMarcFincTrait * Get RVK notation * * @return array - * @access public */ public function getRVK() { @@ -2148,7 +2089,6 @@ trait SolrMarcFincTrait * Get BK notation * * @return array - * @access public */ public function getBK() { @@ -2200,7 +2140,6 @@ trait SolrMarcFincTrait * Get DDC notation * * @return array - * @access public */ public function getDDC() { @@ -2225,7 +2164,6 @@ trait SolrMarcFincTrait * Get an array of citations and references notes. * * @return array - * @access public */ public function getReferenceNotes() { @@ -2236,7 +2174,6 @@ trait SolrMarcFincTrait * Get the publishers number and source of the record. * * @return array - * @access public */ public function getPublisherNumber() { @@ -2247,7 +2184,6 @@ trait SolrMarcFincTrait * Get the musical key of a piece (Marc 384). * * @return array - * @access public */ public function getMusicalKey() { @@ -2259,7 +2195,6 @@ trait SolrMarcFincTrait * * @return array Items internal Bibliotheca-ID called "Mediennummer" * @deprecated Remove when Bibliotheca support ends - * @access public */ public function getMediennummer() { @@ -2284,7 +2219,6 @@ trait SolrMarcFincTrait * Get title uniform * * @return array - * @access public */ public function getTitleUniform() { @@ -2386,14 +2320,13 @@ trait SolrMarcFincTrait * Get the delivery status of the record. * * @return string - * @access public */ public function getDeliveryStatus() { $retVal = []; $statuses = $this->getMarcRecord()->getFields('366'); - if(!is_null($statuses)) { + if(null !== $statuses) { foreach ($statuses as $status) { $value = $status->getSubfield('e'); if($value) { @@ -2430,7 +2363,7 @@ trait SolrMarcFincTrait preg_match('/([1-9]\d*)/', $data, $matches); if ($page = $matches[0]) { - return (int) $page; + return (int)$page; } } return null; @@ -2500,4 +2433,4 @@ trait SolrMarcFincTrait } return null; } -} \ No newline at end of file +}