/** * 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. * * @param DOMElement $parentElement * @param Item $item */ public function appendHeader($parentElement, $item) { $headerData['identifier'] = OaiPmhRepository_OaiIdentifier::itemToOaiId($item->id); $headerData['datestamp'] = OaiPmhRepository_Date::dbToUtc($item->modified); $collection = $item->getCollection(); if ($collection && $collection->public) { $headerData['setSpec'] = $collection->id; } $parentElement->appendNewElementWithChildren('header', $headerData); }