/** * @param array $contact Submitted contact details * @param CTCTContact $ExistingContact Existing contact object */ private static function mapMergeVars($contact, &$ExistingContact) { if (!empty($contact['first_name'])) { $ExistingContact->setFirstName($contact['first_name']); } if (!empty($contact['middle_name'])) { $ExistingContact->setMiddleName($contact['middle_name']); } if (!empty($contact['last_name'])) { $ExistingContact->setLastName($contact['last_name']); } if (!empty($contact['company_name'])) { $ExistingContact->setCompanyName($contact['company_name']); } if (!empty($contact['job_title'])) { $ExistingContact->setJobTitle($contact['job_title']); } if (!empty($contact['home_number'])) { $ExistingContact->setHomeNumber($contact['home_number']); } if (!empty($contact['work_number'])) { $ExistingContact->setWorkNumber($contact['work_number']); } if (!empty($contact['address_line_1'])) { $ExistingContact->setAddr1($contact['address_line_1']); } if (!empty($contact['address_line_2'])) { $ExistingContact->setAddr2($contact['address_line_2']); } if (!empty($contact['address_line_3'])) { $ExistingContact->setAddr3($contact['address_line_3']); } if (!empty($contact['city_name'])) { $ExistingContact->setCity($contact['city_name']); } if (!empty($contact['state_code'])) { $ExistingContact->setStateCode($contact['state_code']); $ExistingContact->setStateName(''); } if (!empty($contact['state_name'])) { $ExistingContact->setStateName($contact['state_name']); $ExistingContact->setStateCode(''); } if (!empty($contact['country_code'])) { $ExistingContact->setCountryCode($contact['country_code']); } if (!empty($contact['zip_code'])) { $ExistingContact->setPostalCode($contact['zip_code']); } if (!empty($contact['sub_zip_code'])) { $ExistingContact->setSubPostalCode($contact['sub_zip_code']); } if (!empty($contact['notes'])) { $ExistingContact->setNotes($contact['notes']); } if (!empty($contact['custom_field_1'])) { $ExistingContact->setCustomField1($contact['custom_field_1']); } if (!empty($contact['custom_field_2'])) { $ExistingContact->setCustomField2($contact['custom_field_2']); } if (!empty($contact['custom_field_3'])) { $ExistingContact->setCustomField3($contact['custom_field_3']); } if (!empty($contact['custom_field_4'])) { $ExistingContact->setCustomField4($contact['custom_field_4']); } if (!empty($contact['custom_field_5'])) { $ExistingContact->setCustomField5($contact['custom_field_5']); } if (!empty($contact['custom_field_6'])) { $ExistingContact->setCustomField6($contact['custom_field_6']); } if (!empty($contact['custom_field_7'])) { $ExistingContact->setCustomField7($contact['custom_field_7']); } if (!empty($contact['custom_field_8'])) { $ExistingContact->setCustomField8($contact['custom_field_8']); } if (!empty($contact['custom_field_9'])) { $ExistingContact->setCustomField9($contact['custom_field_9']); } if (!empty($contact['custom_field_10'])) { $ExistingContact->setCustomField10($contact['custom_field_10']); } if (!empty($contact['custom_field_11'])) { $ExistingContact->setCustomField11($contact['custom_field_11']); } if (!empty($contact['custom_field_12'])) { $ExistingContact->setCustomField12($contact['custom_field_12']); } if (!empty($contact['custom_field_13'])) { $ExistingContact->setCustomField13($contact['custom_field_13']); } if (!empty($contact['custom_field_14'])) { $ExistingContact->setCustomField14($contact['custom_field_14']); } if (!empty($contact['custom_field_15'])) { $ExistingContact->setCustomField15($contact['custom_field_15']); } }