コード例 #1
0
 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';
 }
コード例 #2
0
ファイル: MarcRecord.php プロジェクト: victorfcm/VuFind-Plus
 /**
  * @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();
 }
コード例 #3
0
ファイル: MarcRecord.php プロジェクト: bryandease/VuFind-Plus
 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']));
     }
 }
コード例 #4
0
ファイル: MarcRecord.php プロジェクト: bharatm/NDL-VuFind
 /**
  * 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'));
     }
 }
コード例 #5
0
 public function __construct($record)
 {
     // Call the parent's constructor...
     parent::__construct($record);
 }
コード例 #6
0
ファイル: EadRecord.php プロジェクト: bharatm/NDL-VuFind
 /**
  * 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']);
 }