Skip to content
Snippets Groups Projects
Commit ccf9ef5c authored by Demian Katz's avatar Demian Katz
Browse files

Add OCLC number support to WorldCatEditions module.

parent 48631dcb
No related merge requests found
...@@ -124,6 +124,16 @@ class WorldCat extends SolrMarc ...@@ -124,6 +124,16 @@ class WorldCat extends SolrMarc
return $this->getFieldArray('245', array('h')); return $this->getFieldArray('245', array('h'));
} }
/**
* Get the OCLC number of the record.
*
* @return array
*/
public function getOCLC()
{
return array($this->getUniqueID());
}
/** /**
* Return the unique identifier of this record within the Solr index; * Return the unique identifier of this record within the Solr index;
* useful for retrieving additional information (like tags and user * useful for retrieving additional information (like tags and user
......
...@@ -80,17 +80,24 @@ class WorldCatEditions extends Editions ...@@ -80,17 +80,24 @@ class WorldCatEditions extends Editions
protected function getQueryParts($driver) protected function getQueryParts($driver)
{ {
$parts = array(); $parts = array();
if (method_exists($driver, 'getCleanISBN')) { $oclcNum = $driver->tryMethod('getCleanOCLCNum');
$isbn = $driver->getCleanISBN(); if (!empty($oclcNum)) {
if (!empty($isbn)) { $oclcList = $this->wcUtils->getXOCLCNUM($oclcNum);
$isbnList = $this->wcUtils->getXISBN($isbn); if (!empty($oclcList)) {
$parts[] = '(srw.no any "' . implode(' ', $oclcList) . '")';
}
}
$isbn = $driver->tryMethod('getCleanISBN');
if (!empty($isbn)) {
$isbnList = $this->wcUtils->getXISBN($isbn);
if (!empty($isbnList)) {
$parts[] = '(srw.bn any "' . implode(' ', $isbnList) . '")'; $parts[] = '(srw.bn any "' . implode(' ', $isbnList) . '")';
} }
} }
if (method_exists($driver, 'getCleanISSN')) { $issn = $driver->tryMethod('getCleanISSN');
$issn = $driver->getCleanISSN(); if (!empty($issn)) {
if (!empty($issn)) { $issnList = $this->wcUtils->getXISSN($issn);
$issnList = $this->wcUtils->getXISSN($issn); if (!empty($issnList)) {
$parts[] = '(srw.sn any "' . implode(' ', $issnList) . '")'; $parts[] = '(srw.sn any "' . implode(' ', $issnList) . '")';
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment