Ejemplo n.º 1
0
 /**
  * Constructor.  We build the object using data from the Hoopla records stored on disk.
  * Will be similar to a MarcRecord with slightly different functionality
  *
  * @param array|File_MARC_Record|string $record
  * @access  public
  */
 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::marcExistsForHooplaId($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;
         }
     }
     parent::loadGroupedWork();
 }
Ejemplo n.º 2
0
 /**
  * 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)
 {
     global $configArray;
     // Call the parent's constructor...
     parent::__construct($record);
 }