Skip to content
Snippets Groups Projects
Commit cdd71032 authored by Dorian Merz's avatar Dorian Merz
Browse files

Merge branch 'master-v5' into instance/fid

parents 68a1f311 f9736a3b
No related merge requests found
......@@ -2308,4 +2308,24 @@ trait SolrMarcFincTrait
{
return $this->getFieldArray('501');
}
/**
* Get total number of record pages
* Reads MARC field 300|a
*
* @return int|null
*/
public function getNumberOfPages()
{
if ($data = $this->getMarcRecord()->getField('300')->getSubfield('a')->getData())
{
// Grab first occurance of a number
preg_match('/([1-9]\d*)/', $data, $matches);
if ($page = $matches[0])
{
return (int) $page;
}
}
return null;
}
}
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