Skip to content
Snippets Groups Projects
Commit 056286a6 authored by Dorian Merz's avatar Dorian Merz Committed by Robert Lange
Browse files

refs #18365 [finc] add getOtherIdentifiers function

* reads MARC 024
* specifies type of identifier
* also defines MultiLine RecordDataFormatterSpecs for other identifiers
parent 39c79d01
No related merge requests found
...@@ -356,6 +356,32 @@ trait SolrMarcFincTrait ...@@ -356,6 +356,32 @@ trait SolrMarcFincTrait
return $retval; return $retval;
} }
/**
* Method reading MARC field 24
*
* @return array
* @access public
*/
public function getOtherIdentifiers()
{
$fields = $this->getMarcRecord()->getFields('024');
if (!$fields) {
return null;
}
foreach ($fields as $field) {
if ($subfield = $field->getSubfield('a')) {
$data = $subfield->getData();
$type = 'unspecified';
if ($field->getIndicator('1') == '7' && $sub2 = $field->getSubfield('2')) {
$type = $sub2->getData();
}
$retval[$type][] = $data;
}
}
return $retval;
}
/** /**
* Get an array of instrumentation notes taken from the local data * Get an array of instrumentation notes taken from the local data
* of the Petrucci music library subfield 590b * of the Petrucci music library subfield 590b
......
...@@ -134,4 +134,25 @@ trait MultiDataFieldsTrait ...@@ -134,4 +134,25 @@ trait MultiDataFieldsTrait
return $final; return $final;
} }
/**
* return render details for otherIdentifiers (MARC 024) data set
* @return callback
*/
public function otherIdentifiers($data, $options, $driver)
{
// Sort the data:
$final = [];
foreach ($data as $type => $values) {
$final[] = [
'label' => $type,
'values' => $values,
'options' => [
'pos' => $options['pos'],
'renderType' => 'Simple',
],
];
}
return $final;
}
} }
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