<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*
*/
protected $_saveMapping;
+ /**
+ *
+ */
function __construct() {
$this->_lookupCache = array();
$this->_saveMapping = array();
}
+ /**
+ * @param $file
+ */
function run($file) {
$json = file_get_contents($file);
CRM_Core_Config::clearDBCache();
}
+ /**
+ * @param $contact
+ */
function contact(&$contact) {
$this->restore($contact,
'CRM_Contact_DAO_Contact',
);
}
+ /**
+ * @param $email
+ */
function email(&$email) {
$this->restore($email,
'CRM_Core_DAO_Email',
);
}
+ /**
+ * @param $phone
+ */
function phone(&$phone) {
$this->restore($phone,
'CRM_Core_DAO_Phone',
);
}
+ /**
+ * @param $address
+ */
function address(&$address) {
$this->restore($address,
'CRM_Core_DAO_Address',
);
}
+ /**
+ * @param $note
+ */
function note(&$note) {
$this->restore($note,
'CRM_Core_DAO_Note',
);
}
+ /**
+ * @param $relationship
+ */
function relationship(&$relationship) {
$this->restore($relationship,
'CRM_Contact_DAO_Relationship',
);
}
+ /**
+ * @param $activity
+ * @param $activityContacts
+ */
function activity($activity, $activityContacts) {
$this->restore($activity,
'CRM_Activity_DAO_Activity',
);
}
+ /**
+ * @param $group
+ * @param $groupContact
+ */
function group($group, $groupContact) {
$this->restore($group,
'CRM_Contact_DAO_Group',
);
}
+ /**
+ * @param $tag
+ * @param $entityTag
+ */
function tag($tag, $entityTag) {
$this->restore($tag,
'CRM_Core_DAO_Tag',
);
}
+ /**
+ * @param $chunk
+ * @param string $daoName
+ * @param null $lookUpMapping
+ * @param null $dateFields
+ */
function restore(&$chunk, $daoName, $lookUpMapping = NULL, $dateFields = NULL) {
$object = new $daoName();
$tableName = $object->__table;
}
}
+ /**
+ * @param string $tableName
+ */
function populateCache($tableName) {
if (isset($this->_lookupCache[$tableName])) {
return;