Skip to content
Snippets Groups Projects
Commit a04b0224 authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Implement getContainerEndPage() for EDS (#1784)

parent 7ad57142
No related merge requests found
......@@ -782,6 +782,29 @@ class EDS extends DefaultRecord
return $pagination['StartPage'] ?? '';
}
/**
* Get the end page of the item that contains this record.
*
* @return string
*/
public function getContainerEndPage()
{
// EBSCO doesn't make this information readily available, but in some
// cases we can abstract it from an OpenURL.
$startPage = $this->getContainerStartPage();
if (!empty($startPage)) {
$regex = "/&pages={$startPage}-(\d+)/";
foreach ($this->getFTCustomLinks() as $link) {
if (preg_match($regex, $link['Url'] ?? '', $matches)) {
if (isset($matches[1])) {
return $matches[1];
}
}
}
}
return '';
}
/**
* Returns an array of formats based on publication type.
*
......
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