Exemplo n.º 1
0
 /**
  * Set raw data to initialize the object.
  *
  * @param mixed $data Raw data representing the record; Record Model
  * objects are normally constructed by Record Driver objects using data
  * passed in from a Search Results object.  In this case, $data is a MARCXML
  * document.
  *
  * @return void
  */
 public function setRawData($data)
 {
     // Make sure the XML has an appropriate header:
     if (strlen($data) > 2 && substr($data, 0, 2) != '<?') {
         $data = '<?xml version="1.0"?>' . $data;
     }
     // Map the WorldCat response into a format that the parent Solr-based
     // record driver can understand.
     parent::setRawData(array('fullrecord' => $data));
 }
Exemplo n.º 2
0
 /**
  * Set raw data to initialize the object.
  *
  * @param mixed $data Raw data representing the record; Record Model
  * objects are normally constructed by Record Driver objects using data
  * passed in from a Search Results object.  In this case, $data is a MARCXML
  * document.
  *
  * @return void
  */
 public function setRawData($data)
 {
     // Ensure that $driver->setRawData($driver->getRawData()) doesn't blow up:
     if (isset($data['fullrecord'])) {
         $data = $data['fullrecord'];
     }
     // Make sure the XML has an appropriate header:
     if (strlen($data) > 2 && substr($data, 0, 2) != '<?') {
         $data = '<?xml version="1.0"?>' . $data;
     }
     // Map the WorldCat response into a format that the parent Solr-based
     // record driver can understand.
     parent::setRawData(['fullrecord' => $data]);
 }