+
+ // All mappings WDS66->mailer
+ $mappings = array(
+ 'anrede' => 'gender',
+ 'vorname' => 'surname',
+ 'name' => 'family',
+ 'strasse' => 'street_nr',
+ 'plz' => 'zip',
+ 'ort' => 'city',
+ 'email' => 'email',
+ 'birth_day' => 'birth_day',
+ 'birth_month' => 'birth_month',
+ 'birth_year' => 'birth_year',
+ 'werber' => 'wernis_refid'
+ );
+
+ // Array for mapped data
+ $mappedData = array();
+
+ // Map all WDS66 entries into mailer entries
+ foreach ($mappings as $from => $to) {
+ // All must exist
+ if (!isset($userData[$from])) {
+ // Element $from does not exist
+ reportBug(__FUNCTION__, __LINE__, 'Cannot map from=' . $from . ' -> to=' . $to . ': element does not exist.');
+ } // END - if
+
+ // "Map" all
+ $mappedData[$to] = convertEmptyToNull($userData[$from]);
+ } // END - foreach
+
+ // Both arrays must have same size
+ assert(count($userData) == count($mappedData));
+
+ // Now add userid and registration provider from WDS66
+ $mappedData['wernis_userid'] = bigintval($rows[0]['wernis_userid']);
+ $mappedData['registration_provider'] = 'wernis';
+
+ die(__FUNCTION__ . '<pre>'.print_r($mappedData, TRUE).'</pre>');