Skip to content
Snippets Groups Projects
Commit f2b54249 authored by Gregor Gawol's avatar Gregor Gawol Committed by Dorian Merz
Browse files

refs #17129 [master] display former titles

* added method
parent 758088a6
No related merge requests found
......@@ -1549,6 +1549,37 @@ trait SolrMarcFincTrait
return $retval;
}
/**
* Returns former title stored in Marc 247$a.
* Refs. #17129
*
* @return array|null
*/
public function getFormerTitle()
{
$retval = [];
$fields = $this->getMarcRecord()->getFields('247');
if (!$fields) {
return null;
}
foreach ($fields as $field) {
$subfieldA = $field->getSubfield('a');
if ($subfieldA
&& ($field->getIndicator('2') == 0)
) {
$value = $subfieldA->getData();
if ($subfieldF = $field->getSubfield('f')) {
$value = $value . ' (' . $subfieldF->getData() . ')';
}
$retval[] = $value;
}
}
return $retval;
}
/**
* Returns all notes.
*
......@@ -1558,6 +1589,7 @@ trait SolrMarcFincTrait
{
$notes = array_merge(
(array)$this->getGeneralNotes(),
(array)$this->getFormerTitle(),
(array)$this->getAdditionalNotes()
);
foreach ($notes as &$note) {
......
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