CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Dedupe API
Pages: [1]

Author Topic: Dedupe API  (Read 611 times)

Adam Wight

  • I’m new here
  • *
  • Posts: 9
  • Karma: 3
  • CiviCRM version: 4.2.x
  • CMS version: Drupal
  • MySQL version: 5
  • PHP version: 5.3
Dedupe API
January 17, 2013, 04:04:15 pm
Comrades,
I'd like to write an api which exposes dedupe logic to allow for scripting in extensions.  The "find" and "merge" logic in pretty good shape, the api would just be a simple wrapper around those.  "Diff" is another can o' worms, but I think the logic in CRM_Contact_Form_Merge could be extracted.

These methods could be hung off of the Contact api -- there is already a basic "merge" method there.

So far, the high-level methods I expect we want are:

Find Dupes
This would be run on the entire list of contacts, on a single existing contact, or on contact data before insertion.  A dedupe rule must be specified.

The whole-database case can get tricky, because it's an all-to-all comparison, the effort increases faster than db size.  I'm not sure if we should provide a built-in way to break this into smaller jobs, or if we should leave it for extension authors.

Diff Contacts
Given two existing contacts, return the differences in a format which could be used to generate a form such as Contact_Form_Merge, and can be used as input to the merge function.

Merge Contacts
Transfer all contact belongings.  Options to control whether data like address is overwritten, appended, or ignored.

-Adam
« Last Edit: January 17, 2013, 05:34:35 pm by Adam Wight »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Dedupe API

This forum was archived on 2017-11-26.