Beispiel #1
0
 /**
  * Appends the record's header to the XML response.
  *
  * Adds the identifier, datestamp and setSpec to a header element, and
  * appends in to the document.  
  *
  * @uses appendHeader
  * @uses appendMetadata
  */
 public function appendHeader()
 {
     $table = new OaiFinds();
     if (array_key_exists('0', $this->item)) {
         $itemid = $this->item['0']['id'];
         $updated = $this->item['0']['created'];
         $collectionId = $this->item['0']['institution'];
     } else {
         $itemid = $this->item['id'];
         $updated = $this->item['created'];
         $collectionId = $this->item['institution'];
     }
     $item = $table->fetchRow($table->select()->where('finds.id = ?', $itemid));
     $object = new Pas_OaiPmhRepository_OaiIdentifier();
     $itemNumber = $object->itemToOaiId($itemid);
     $headerData['identifier'] = $itemNumber;
     $headerData['datestamp'] = self::dbToUtc($updated);
     if ($collectionId) {
         $headerData['setSpec'] = $collectionId;
     }
     $this->createElementWithChildren($this->parentElement, 'header', $headerData);
 }