Merge pull request #14222 from mfb/debug-var
[civicrm-core.git] / CRM / Utils / Migrate / ImportJSON.php
index f39318fdaf3e2b165daa61ef8296adbc5adb54ae..ce6eb02d9665fa2726a24f25342ee4246fbed24a 100644 (file)
@@ -40,8 +40,8 @@ class CRM_Utils_Migrate_ImportJSON {
    * Class constructor.
    */
   public function __construct() {
-    $this->_lookupCache = array();
-    $this->_saveMapping = array();
+    $this->_lookupCache = [];
+    $this->_saveMapping = [];
   }
 
   /**
@@ -81,8 +81,8 @@ class CRM_Utils_Migrate_ImportJSON {
   public function contact(&$contact) {
     $this->restore($contact,
       'CRM_Contact_DAO_Contact',
-      array('id' => 'civicrm_contact'),
-      array('birth_date', 'deceased_date', 'created_date', 'modified_date')
+      ['id' => 'civicrm_contact'],
+      ['birth_date', 'deceased_date', 'created_date', 'modified_date']
     );
   }
 
@@ -92,7 +92,7 @@ class CRM_Utils_Migrate_ImportJSON {
   public function email(&$email) {
     $this->restore($email,
       'CRM_Core_DAO_Email',
-      array('contact_id' => 'civicrm_contact')
+      ['contact_id' => 'civicrm_contact']
     );
   }
 
@@ -102,7 +102,7 @@ class CRM_Utils_Migrate_ImportJSON {
   public function phone(&$phone) {
     $this->restore($phone,
       'CRM_Core_DAO_Phone',
-      array('contact_id' => 'civicrm_contact')
+      ['contact_id' => 'civicrm_contact']
     );
   }
 
@@ -112,7 +112,7 @@ class CRM_Utils_Migrate_ImportJSON {
   public function address(&$address) {
     $this->restore($address,
       'CRM_Core_DAO_Address',
-      array('contact_id' => 'civicrm_contact')
+      ['contact_id' => 'civicrm_contact']
     );
   }
 
@@ -122,8 +122,8 @@ class CRM_Utils_Migrate_ImportJSON {
   public function note(&$note) {
     $this->restore($note,
       'CRM_Core_DAO_Note',
-      array('contact_id' => 'civicrm_contact'),
-      array('modified_date')
+      ['contact_id' => 'civicrm_contact'],
+      ['modified_date']
     );
   }
 
@@ -133,10 +133,10 @@ class CRM_Utils_Migrate_ImportJSON {
   public function relationship(&$relationship) {
     $this->restore($relationship,
       'CRM_Contact_DAO_Relationship',
-      array(
+      [
         'contact_id_a' => 'civicrm_contact',
         'contact_id_b' => 'civicrm_contact',
-      )
+      ]
     );
   }
 
@@ -148,15 +148,15 @@ class CRM_Utils_Migrate_ImportJSON {
     $this->restore($activity,
       'CRM_Activity_DAO_Activity',
       NULL,
-      array('activity_date_time')
+      ['activity_date_time']
     );
 
     $this->restore($activityContacts,
       'CRM_Activity_DAO_ActivityContact',
-      array(
+      [
         'contact_id' => 'civicrm_contact',
         'activity_id' => 'civicrm_activity',
-      )
+      ]
     );
   }
 
@@ -168,15 +168,15 @@ class CRM_Utils_Migrate_ImportJSON {
     $this->restore($group,
       'CRM_Contact_DAO_Group',
       NULL,
-      array('cache_date', 'refresh_date')
+      ['cache_date', 'refresh_date']
     );
 
     $this->restore($groupContact,
       'CRM_Contact_DAO_GroupContact',
-      array(
+      [
         'group_id' => 'civicrm_group',
         'contact_id' => 'civicrm_contact',
-      )
+      ]
     );
   }
 
@@ -187,18 +187,18 @@ class CRM_Utils_Migrate_ImportJSON {
   public function tag($tag, $entityTag) {
     $this->restore($tag,
       'CRM_Core_DAO_Tag',
-      array(
+      [
         'created_id' => 'civicrm_contact',
         'parent_id' => 'civicrm_tag',
-      )
+      ]
     );
 
     $this->restore($entityTag,
       'CRM_Core_DAO_EntityTag',
-      array(
+      [
         'entity_id' => 'civicrm_contact',
         'tag_id' => 'civicrm_tag',
-      )
+      ]
     );
   }
 
@@ -216,7 +216,7 @@ class CRM_Utils_Migrate_ImportJSON {
       $lookUpMapping['id'] = $tableName;
     }
     else {
-      $lookUpMapping = array('id' => $tableName);
+      $lookUpMapping = ['id' => $tableName];
     }
 
     foreach ($lookUpMapping as $columnName => $tableName) {
@@ -269,7 +269,7 @@ class CRM_Utils_Migrate_ImportJSON {
         continue;
       }
 
-      $mapValues = array();
+      $mapValues = [];
       CRM_Core_DAO::executeQuery("DELETE FROM civicrm_migration_mapping where entity_table = '$tableName'");
       foreach ($values as $childID => $masterID) {
         $mapValues[] = "($masterID,$childID,'$tableName' )";
@@ -287,7 +287,7 @@ class CRM_Utils_Migrate_ImportJSON {
       return;
     }
 
-    $this->_lookupCache[$tableName] = array();
+    $this->_lookupCache[$tableName] = [];
     $this->_saveMapping[$tableName] = FALSE;
 
     $query = "SELECT master_id, slave_id