CRM-20357 remove unused Finder::dupesOfContact function.
authoreileen <emcnaughton@wikimedia.org>
Wed, 29 Mar 2017 01:57:55 +0000 (14:57 +1300)
committereileen <emcnaughton@wikimedia.org>
Wed, 29 Mar 2017 01:59:57 +0000 (14:59 +1300)
I can find no evidence this function is used anywhere

CRM/Dedupe/Finder.php

index eb1fd1fcbbeba5e711b9c1e3d4a3479c93016192..f0f17167528638f3ce4050b96457a997834d579b 100644 (file)
@@ -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