.scripts/contentdm.php
/**
   * Step 3.1 - Update Fields
   *
   * Updates the database with the assumption that CONTENTdm is more accurate.
   *
   * @param Array $results -- The local manuscript.
   * @param Array $record  -- The manuscript from CONTENTdm.
   */
Step 3.1 - Update Fields
Updates the database with the assumption that CONTENTdm is more accurate.

@param Array $results -- The local manuscript.
@param Array $record  -- The manuscript from CONTENTdm.
Step 3 . 1 - Update Fields Updates the database with the assumption that CONTENTdm is more accurate . @param Array $results -- The local manuscript . @param Array $record -- The manuscript from CONTENTdm .
private function updateDatabase($results, $record) {
    $writer = "";
    $update = array(
      ":pointer"    => $record["pointer"],
      ":collection" => $this->collection
    );
    foreach ($record as $key=>$value) {
      $value = trim((string) $value);
      if ($value === "" || $value === $results[$key]) {
        continue;
      }
      $writer .= $key . " = :" . $key . ", ";
      $update[":" . $key] = $value;
    }
    $update = array_merge($update, $this->retrieveCompoundPage($record));
    $update = array_merge($update, $this->retrieveImageDimensions($record));
    $update = array_merge($update, $this->determineCompoundObject($record["pointer"]));
    $writer .= "compound_page = :compound_page, image_height = :image_height, image_width = :image_width, is_compound_object = :is_compound_object";
    $this->logger("Query: UPDATE manuscripts SET (" . $writer . ") WHERE pointer = " . $record["pointer"]);
    $this->logger(print_r($update, true));
    $prepare = $this->database->prepare("
      UPDATE manuscripts
      SET    $writer
      WHERE  pointer = :pointer
        AND  collection = :collection
    ");
    $prepare->execute($update);
  }
private function updateDatabase ( $ results , $ record ) { $ writer = " " ; $ update = array ( " :pointer " => $ record [ " pointer " ] , " :collection " => $ this -> collection ) ; foreach ( $ record as $ key => $ value ) { $ value = trim ( ( string ) $ value ) ; if ( $ value === " " || $ value === $ results [ $ key ] ) { continue ; } $ writer .= $ key . "  = : " . $ key . " ,  " ; $ update [ " : " . $ key ] = $ value ; } $ update = array_merge ( $ update , $ this -> retrieveCompoundPage ( $ record ) ) ; $ update = array_merge ( $ update , $ this -> retrieveImageDimensions ( $ record ) ) ; $ update = array_merge ( $ update , $ this -> determineCompoundObject ( $ record [ " pointer " ] ) ) ; $ writer .= " compound_page = :compound_page, image_height = :image_height, image_width = :image_width, is_compound_object = :is_compound_object " ; $ this -> logger ( " Query: UPDATE manuscripts SET ( " . $ writer . " ) WHERE pointer =  " . $ record [ " pointer " ] ) ; $ this -> logger ( print_r ( $ update , true ) ) ; $ prepare = $ this -> database -> prepare ( " 
      UPDATE manuscripts
      SET     $ writer 
      WHERE  pointer = :pointer
        AND  collection = :collection
     " ) ; $ prepare -> execute ( $ update ) ; }
Step 3.1 - Update Fields
 Updates the database with the assumption that CONTENTdm is more accurate.
Step 3 . 1 - Update Fields Updates the database with the assumption that CONTENTdm is more accurate .
// Assure value is a string and trimmed. // No point in populating empty or same data.