Esempio n. 1
0
 /**
  * Update a single record by identifier.
  * @param $identifier string
  * @param $params array
  */
 function updateRecord($identifier, $params = array())
 {
     $verb = 'GetRecord';
     $this->throttle();
     $parser = new XMLParser();
     $result =& $parser->parse($this->addParameters($this->oaiUrl, array('verb' => $verb, 'identifier' => $identifier, 'metadataPrefix' => $this->getMetadataFormat())));
     if (!$parser->getStatus()) {
         foreach ($parser->getErrors() as $error) {
             $this->addError($error);
         }
         if (!$result) {
             return false;
         }
     }
     $parser->destroy();
     unset($parser);
     if ($errorNode =& $result->getChildByName('error')) {
         $this->addError($errorNode->getValue());
     }
     $verbNode =& $result->getChildByName($verb);
     $recordNode =& $result->getChildByName(array('record', 'oai:record'));
     if ($recordNode) {
         $this->handleRecordNode($recordNode);
     }
     $result->destroy();
     return true;
 }