Skip to content

Commit

Permalink
EPF: Fix electronic ISSNs and ISBNs (vufind-org#3825)
Browse files Browse the repository at this point in the history
  • Loading branch information
maccabeelevine authored Jul 12, 2024
1 parent b5e0924 commit d2ce442
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
20 changes: 20 additions & 0 deletions module/VuFind/src/VuFind/RecordDriver/EPF.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ public function getThumbnail($size = 'small')
return DefaultRecord::getThumbnail($size);
}

/**
* Get ISSNs (of containing record)
*
* @return array
*/
public function getISSNs()
{
return $this->getFilteredIdentifiers(['issn-print', 'issn-online']);
}

/**
* Get an array of ISBNs
*
* @return array
*/
public function getISBNs()
{
return $this->getFilteredIdentifiers(['isbn-print', 'isbn-online']);
}

/**
* Get the list of full text holdings for the record
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ public function testGetFullTextHoldings(): void
);
}

/**
* Test getIssns for a record.
*
* @return void
*/
public function testGetIssns(): void
{
$issns = $this->getDriverWithIdentifierData()->getISSNs();
$this->assertEquals(
['19494998', '19495005'],
$issns
);
}

/**
* Get a record driver with fake identifier data.
*
Expand All @@ -85,6 +99,26 @@ protected function getDriverWithIdentifierData(): EPF
'Header' => [
'PublicationId' => '1234-5678',
],
'RecordInfo' => [
'BibRecord' => [
'BibEntity' => [
'Identifiers' => [
[
'Type' => 'issn-print',
'Value' => '19494998',
],
[
'Type' => 'issn-online',
'Value' => '19495005',
],
[
'Type' => 'ejsid',
'Value' => '723124',
],
],
],
],
],
'FullTextHoldings' => [
[
'FullTextHolding' => [
Expand Down

0 comments on commit d2ce442

Please sign in to comment.