+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2018 |
+ | Copyright CiviCRM LLC (c) 2004-2019 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2018
+ * @copyright CiviCRM LLC (c) 2004-2019
*/
class CRM_Utils_Migrate_ImportJSON {
* Class constructor.
*/
public function __construct() {
- $this->_lookupCache = array();
- $this->_saveMapping = array();
+ $this->_lookupCache = [];
+ $this->_saveMapping = [];
}
/**
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']
);
}
public function email(&$email) {
$this->restore($email,
'CRM_Core_DAO_Email',
- array('contact_id' => 'civicrm_contact')
+ ['contact_id' => 'civicrm_contact']
);
}
public function phone(&$phone) {
$this->restore($phone,
'CRM_Core_DAO_Phone',
- array('contact_id' => 'civicrm_contact')
+ ['contact_id' => 'civicrm_contact']
);
}
public function address(&$address) {
$this->restore($address,
'CRM_Core_DAO_Address',
- array('contact_id' => 'civicrm_contact')
+ ['contact_id' => 'civicrm_contact']
);
}
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']
);
}
public function relationship(&$relationship) {
$this->restore($relationship,
'CRM_Contact_DAO_Relationship',
- array(
+ [
'contact_id_a' => 'civicrm_contact',
'contact_id_b' => 'civicrm_contact',
- )
+ ]
);
}
$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',
- )
+ ]
);
}
$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',
- )
+ ]
);
}
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',
- )
+ ]
);
}
$lookUpMapping['id'] = $tableName;
}
else {
- $lookUpMapping = array('id' => $tableName);
+ $lookUpMapping = ['id' => $tableName];
}
foreach ($lookUpMapping as $columnName => $tableName) {
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' )";
return;
}
- $this->_lookupCache[$tableName] = array();
+ $this->_lookupCache[$tableName] = [];
$this->_saveMapping[$tableName] = FALSE;
$query = "SELECT master_id, slave_id