INFRA-132 - Batch #7
[civicrm-core.git] / CRM / Dedupe / Merger.php
index 3d0da9030f55310ea3ed40d403a8a9b28dfa6129..17daf65be2795afd4dd39c5c0c83d0c4ad9a9fab 100644 (file)
  */
 class CRM_Dedupe_Merger {
 
-  // FIXME: consider creating a common structure with cidRefs() and eidRefs()
-  // FIXME: the sub-pages references by the URLs should
-  // be loaded dynamically on the merge form instead
   /**
+   * FIXME: consider creating a common structure with cidRefs() and eidRefs()
+   * FIXME: the sub-pages references by the URLs should
+   * be loaded dynamically on the merge form instead
    * @return array
    */
   public static function relTables() {
@@ -415,7 +415,6 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    * Based on the provided two contact_ids and a set of tables, move the
    * belongings of the other contact to the main one.
    *
-   * @static
    */
   public static function moveContactBelongings($mainId, $otherId, $tables = FALSE, $tableOperations = array()) {
     $cidRefs = self::cidRefs();
@@ -524,7 +523,6 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *   Contact details.
    *
    * @return array
-   * @static
    */
   public static function findDifferences($main, $other) {
     $result = array(
@@ -565,12 +563,11 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *   Helps decide how to behave when there are conflicts.
    *                              A 'safe' value skips the merge if there are any un-resolved conflicts.
    *                              Does a force merge otherwise.
-   * @param bool $autoFlipWether to let api decide which contact to retain and which to delete.
+   * @param bool $autoFlip to let api decide which contact to retain and which to delete.
    *   Wether to let api decide which contact to retain and which to delete.
    * @param bool $redirectForPerformance
    *
    * @return array|bool
-   * @static
    */
   public static function batchMerge($rgid, $gid = NULL, $mode = 'safe', $autoFlip = TRUE, $redirectForPerformance = FALSE) {
     $contactType = CRM_Core_DAO::getFieldValue('CRM_Dedupe_DAO_RuleGroup', $rgid, 'contact_type');
@@ -611,14 +608,13 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *   Helps decide how to behave when there are conflicts.
    *                             A 'safe' value skips the merge if there are any un-resolved conflicts.
    *                             Does a force merge otherwise (aggressive mode).
-   * @param bool $autoFlipWether to let api decide which contact to retain and which to delete.
+   * @param bool $autoFlip to let api decide which contact to retain and which to delete.
    *   Wether to let api decide which contact to retain and which to delete.
    *
    *
    * @param bool $redirectForPerformance
    *
    * @return array|bool
-   * @static
    */
   public static function merge($dupePairs = array(), $cacheParams = array(), $mode = 'safe',
                                $autoFlip = TRUE, $redirectForPerformance = FALSE
@@ -708,7 +704,6 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *                                 Does a force merge otherwise (aggressive mode).
    *
    * @return bool
-   * @static
    */
   public static function skipMerge($mainId, $otherId, &$migrationInfo, $mode = 'safe') {
     $conflicts = array();
@@ -819,7 +814,6 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    *   Duplicate contact which would be deleted after merge operation.
    *
    * @return array|bool|int
-   * @static
    */
   public static function getRowsElementsAndInfo($mainId, $otherId) {
     $qfZeroBug = 'e8cddb72-a257-11dc-b9cc-0016d3330ee9';
@@ -829,7 +823,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       $params = array(
         'contact_id' => $cid,
         'version' => 3,
-        'return' => array_merge(array('display_name'), self::getContactFields())
+        'return' => array_merge(array('display_name'), self::getContactFields()),
       );
       $result = civicrm_api('contact', 'get', $params);
 
@@ -861,11 +855,10 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
         $specialValues[$moniker]['preferred_communication_method'] = CRM_Core_DAO::VALUE_SEPARATOR . $prefCommList . CRM_Core_DAO::VALUE_SEPARATOR;
       }
       $names = array(
-        'preferred_communication_method' =>
-          array(
-            'newName' => 'preferred_communication_method_display',
-            'groupName' => 'preferred_communication_method',
-          ),
+        'preferred_communication_method' => array(
+          'newName' => 'preferred_communication_method_display',
+          'groupName' => 'preferred_communication_method',
+        ),
       );
       CRM_Core_OptionGroup::lookupValues($specialValues[$moniker], $names);
 
@@ -1223,7 +1216,6 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
    * @param $migrationInfo
    *
    * @return bool
-   * @static
    */
   public static function moveAllBelongings($mainId, $otherId, $migrationInfo) {
     if (empty($migrationInfo)) {
@@ -1437,7 +1429,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
                 if (in_array($htmlType, array(
                   'CheckBox',
                   'Multi-Select',
-                  'AdvMulti-Select'
+                  'AdvMulti-Select',
                 ))) {
                   $submitted[$key] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
                       $mergeValue
@@ -1450,7 +1442,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
             }
             elseif (in_array($htmlType, array(
               'Multi-Select Country',
-              'Multi-Select State/Province'
+              'Multi-Select State/Province',
             ))) {
               //we require submitted values should be in array format
               if ($value) {
@@ -1610,7 +1602,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
 
   /**
    * @return array
-   *   of field names which will be compared, so everything except ID.
+   *   Array of field names which will be compared, so everything except ID.
    */
   public static function getContactFields() {
     $contactFields = CRM_Contact_DAO_Contact::fields();
@@ -1624,7 +1616,7 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
       'modified_date',
       'primary_contact_id',
       'sort_name',
-      'user_unique_id'
+      'user_unique_id',
     );
     foreach ($contactFields as $field => $value) {
       if (in_array($field, $invalidFields)) {
@@ -1636,10 +1628,10 @@ INNER JOIN  civicrm_membership membership2 ON membership1.membership_type_id = m
 
   /**
    * Added for CRM-12695
-   * Based on the contactId provided
+   * Based on the contactID provided
    * add/update membership(s) to related contacts
    *
-   * @param contactId
+   * @param int $contactID
    */
   public static function addMembershipToRealtedContacts($contactID) {
     $dao = new CRM_Member_DAO_Membership();