public function __construct($record = null) { // Call the parent's constructor... parent::__construct($record); // Also process the MARC record: require_once ROOT_DIR . '/sys/MarcLoader.php'; }
/** * @param array|File_MARC_Record|string $record */ public function __construct($record) { if ($record instanceof File_MARC_Record) { $this->marcRecord = $record; } elseif (is_string($record)) { require_once ROOT_DIR . '/sys/MarcLoader.php'; $this->id = $record; $this->valid = MarcLoader::marcExistsForILSId($record); } else { // Call the parent's constructor... parent::__construct($record); // Also process the MARC record: require_once ROOT_DIR . '/sys/MarcLoader.php'; $this->marcRecord = MarcLoader::loadMarcRecordFromRecord($record); if (!$this->marcRecord) { $this->valid = false; } } if (!isset($this->id) && $this->valid) { /** @var File_MARC_Data_Field $idField */ global $configArray; $idField = $this->marcRecord->getField($configArray['Reindex']['recordNumberTag']); if ($idField) { $this->id = $idField->getSubfield('a')->getData(); } } parent::loadGroupedWork(); }
public function __construct($record) { // Call the parent's constructor... parent::__construct($record); // Also process the MARC record: require_once ROOT_DIR . '/sys/MarcLoader.php'; $this->marcRecord = MarcLoader::loadMarcRecordFromRecord($record); if (!$this->marcRecord) { PEAR_Singleton::raiseError(new PEAR_Error('Cannot Process MARC Record for record ' . $record['id'])); } }
/** * Constructor. We build the object using all the data retrieved * from the (Solr) index (which also happens to include the * 'fullrecord' field containing raw metadata). Since we have to * make a search call to find out which record driver to construct, * we will already have this data available, so we might as well * just pass it into the constructor. * * @param array $record All fields retrieved from the index. * * @access public */ public function __construct($record) { // Call the parent's constructor... parent::__construct($record); // Also process the MARC record: $marc = trim($record['fullrecord']); // check if we are dealing with MARCXML if (substr($marc, 0, 1) == '<') { $marc = new File_MARCXML($marc, File_MARCXML::SOURCE_STRING); } else { $marc = preg_replace('/#31;/', "", $marc); $marc = preg_replace('/#30;/', "", $marc); $marc = new File_MARC($marc, File_MARC::SOURCE_STRING); } $this->marcRecord = $marc->next(); if (!$this->marcRecord) { PEAR::raiseError(new PEAR_Error('Cannot Process MARC Record')); } }
public function __construct($record) { // Call the parent's constructor... parent::__construct($record); }
/** * Constructor. We build the object using all the data retrieved * from the (Solr) index (which also happens to include the * 'fullrecord' field containing raw metadata). Since we have to * make a search call to find out which record driver to construct, * we will already have this data available, so we might as well * just pass it into the constructor. * * @param array $indexFields All fields retrieved from the index. * * @access public */ public function __construct($indexFields) { parent::__construct($indexFields); $this->record = simplexml_load_string($this->fields['fullrecord']); }