You are here

function webform_civicrm_civicrm_merge in Webform CiviCRM Integration 6

Same name and namespace in other branches
  1. 8.5 webform_civicrm.module \webform_civicrm_civicrm_merge()
  2. 6.2 webform_civicrm.module \webform_civicrm_civicrm_merge()
  3. 7.5 webform_civicrm.module \webform_civicrm_civicrm_merge()
  4. 7 webform_civicrm.module \webform_civicrm_civicrm_merge()
  5. 7.2 webform_civicrm.module \webform_civicrm_civicrm_merge()
  6. 7.3 webform_civicrm.module \webform_civicrm_civicrm_merge()
  7. 7.4 webform_civicrm.module \webform_civicrm_civicrm_merge()

Implementation of hook_civicrm_merge(). Update submission data to reflect new cid when contacts are merged.

File

./webform_civicrm.module, line 178
Webform CiviCRM Integration Module: Links webform submissions to contacts in a CiviCRM database. @author Coleman Watts

Code

function webform_civicrm_civicrm_merge($type, $data, $new_id = NULL, $old_id = NULL, $tables = NULL) {
  if ($new_id && $old_id && $type == 'sqls') {
    db_query('UPDATE {webform_civicrm_submissions} SET contact_id = %d WHERE contact_id = %d', $new_id, $old_id);
  }
}