From 68aecbf93d98744bef38aa8a76894e4b64433805 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 29 Mar 2017 14:57:55 +1300 Subject: [PATCH 1/1] CRM-20357 remove unused Finder::dupesOfContact function. I can find no evidence this function is used anywhere --- CRM/Dedupe/Finder.php | 44 ------------------------------------------- 1 file changed, 44 deletions(-) diff --git a/CRM/Dedupe/Finder.php b/CRM/Dedupe/Finder.php index eb1fd1fcbb..f0f1716752 100644 --- a/CRM/Dedupe/Finder.php +++ b/CRM/Dedupe/Finder.php @@ -179,50 +179,6 @@ class CRM_Dedupe_Finder { return array(); } - /** - * Return dupes of a given contact, using the default rule group (of a provided usage). - * - * @param int $cid - * Contact id of the given contact. - * @param string $used - * Dedupe rule group usage ('Unsupervised' or 'Supervised' or 'General'). - * @param string $ctype - * Contact type of the given contact. - * - * @return array - * array of dupe contact_ids - */ - public static function dupesOfContact($cid, $used = 'Unsupervised', $ctype = NULL) { - // if not provided, fetch the contact type from the database - if (!$ctype) { - $dao = new CRM_Contact_DAO_Contact(); - $dao->id = $cid; - if (!$dao->find(TRUE)) { - CRM_Core_Error::fatal("contact id of $cid does not exist"); - } - $ctype = $dao->contact_type; - } - $rgBao = new CRM_Dedupe_BAO_RuleGroup(); - $rgBao->used = $used; - $rgBao->contact_type = $ctype; - if (!$rgBao->find(TRUE)) { - CRM_Core_Error::fatal("$used rule for $ctype does not exist"); - } - $dupes = self::dupes($rgBao->id, array($cid)); - - // get the dupes for this cid - $result = array(); - foreach ($dupes as $dupe) { - if ($dupe[0] == $cid) { - $result[] = $dupe[1]; - } - elseif ($dupe[1] == $cid) { - $result[] = $dupe[0]; - } - } - return $result; - } - /** * A hackish function needed to massage CRM_Contact_Form_$ctype::formRule() * object into a valid $params array for dedupe -- 2.25.1