Exemplo n.º 1
0
 $sourceFields = $_POST["sf"];
 $fieldMap = array();
 for ($x = 0; $x < count($targetFields); $x++) {
     if ($targetFields[$x]) {
         $tField = $targetFields[$x];
         if ($tField == 'unmapped') {
             $tField .= '-' . $x;
         }
         $fieldMap[$tField]["field"] = $sourceFields[$x];
     }
 }
 //Set Source PK
 if ($dbpk) {
     $fieldMap["dbpk"]["field"] = $dbpk;
 }
 $duManager->setFieldMap($fieldMap);
 //Set field map for identification history
 if (array_key_exists("ID-sf", $_POST)) {
     $targetIdFields = $_POST["ID-tf"];
     $sourceIdFields = $_POST["ID-sf"];
     $fieldIdMap = array();
     for ($x = 0; $x < count($targetIdFields); $x++) {
         if ($targetIdFields[$x]) {
             $tIdField = $targetIdFields[$x];
             if ($tIdField == 'unmapped') {
                 $tIdField .= '-' . $x;
             }
             $fieldIdMap[$tIdField]["field"] = $sourceIdFields[$x];
         }
     }
     $duManager->setIdentFieldMap($fieldIdMap);