<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
protected $_saveMapping;
/**
- *
*/
- function __construct() {
+ public function __construct() {
$this->_lookupCache = array();
$this->_saveMapping = array();
}
/**
* @param $file
*/
- function run($file) {
+ public function run($file) {
$json = file_get_contents($file);
$decodedContacts = json_decode($json);
/**
* @param $contact
*/
- function contact(&$contact) {
+ public function contact(&$contact) {
$this->restore($contact,
'CRM_Contact_DAO_Contact',
array('id' => 'civicrm_contact'),
/**
* @param $email
*/
- function email(&$email) {
+ public function email(&$email) {
$this->restore($email,
'CRM_Core_DAO_Email',
array('contact_id' => 'civicrm_contact')
/**
* @param $phone
*/
- function phone(&$phone) {
+ public function phone(&$phone) {
$this->restore($phone,
'CRM_Core_DAO_Phone',
array('contact_id' => 'civicrm_contact')
/**
* @param $address
*/
- function address(&$address) {
+ public function address(&$address) {
$this->restore($address,
'CRM_Core_DAO_Address',
array('contact_id' => 'civicrm_contact')
/**
* @param $note
*/
- function note(&$note) {
+ public function note(&$note) {
$this->restore($note,
'CRM_Core_DAO_Note',
array('contact_id' => 'civicrm_contact'),
/**
* @param $relationship
*/
- function relationship(&$relationship) {
+ public function relationship(&$relationship) {
$this->restore($relationship,
'CRM_Contact_DAO_Relationship',
array(
* @param $activity
* @param $activityContacts
*/
- function activity($activity, $activityContacts) {
+ public function activity($activity, $activityContacts) {
$this->restore($activity,
'CRM_Activity_DAO_Activity',
NULL,
* @param $group
* @param $groupContact
*/
- function group($group, $groupContact) {
+ public function group($group, $groupContact) {
$this->restore($group,
'CRM_Contact_DAO_Group',
NULL,
* @param $tag
* @param $entityTag
*/
- function tag($tag, $entityTag) {
+ public function tag($tag, $entityTag) {
$this->restore($tag,
'CRM_Core_DAO_Tag',
array(
* @param null $lookUpMapping
* @param null $dateFields
*/
- function restore(&$chunk, $daoName, $lookUpMapping = NULL, $dateFields = NULL) {
- $object = new $daoName();
+ public function restore(&$chunk, $daoName, $lookUpMapping = NULL, $dateFields = NULL) {
+ $object = new $daoName();
$tableName = $object->__table;
if (is_array($lookUpMapping)) {
$columns = $chunk[0];
foreach ($chunk as $key => $value) {
if ($key) {
- $object = new $daoName();
+ $object = new $daoName();
foreach ($columns as $k => $column) {
if ($column == 'id') {
$childID = $value[$k];
}
}
- function saveCache() {
+ public function saveCache() {
$sql = "INSERT INTO civicrm_migration_mapping (master_id, slave_id, entity_table ) VALUES ";
foreach ($this->_lookupCache as $tableName => & $values) {
/**
* @param string $tableName
*/
- function populateCache($tableName) {
+ public function populateCache($tableName) {
if (isset($this->_lookupCache[$tableName])) {
return;
}
$this->_lookupCache[$dao->slave_id] = $dao->master_id;
}
}
-}
+}