本文整理汇总了PHP中CRM_Core_BAO_Log::_processed方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_Log::_processed方法的具体用法?PHP CRM_Core_BAO_Log::_processed怎么用?PHP CRM_Core_BAO_Log::_processed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_Log
的用法示例。
在下文中一共展示了CRM_Core_BAO_Log::_processed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register
/**
* @param $contactID
* @param $tableName
* @param $tableID
* @param null $userID
*/
static function register($contactID, $tableName, $tableID, $userID = NULL)
{
if (!self::$_processed) {
self::$_processed = array();
}
if (!$userID) {
$session = CRM_Core_Session::singleton();
$userID = $session->get('userID');
}
if (!$userID) {
$api_key = CRM_Utils_Request::retrieve('api_key', 'String', $store, FALSE, NULL, 'REQUEST');
if ($api_key && strtolower($api_key) != 'null') {
$userID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $api_key, 'id', 'api_key');
}
}
if (!$userID) {
$userID = $contactID;
}
if (!$userID) {
return;
}
$log = new CRM_Core_DAO_Log();
$log->id = NULL;
if (isset(self::$_processed[$contactID])) {
if (isset(self::$_processed[$contactID][$userID])) {
$log->id = self::$_processed[$contactID][$userID];
}
self::$_processed[$contactID][$userID] = 1;
} else {
self::$_processed[$contactID] = array($userID => 1);
}
$logData = "{$tableName},{$tableID}";
if (!$log->id) {
$log->entity_table = 'civicrm_contact';
$log->entity_id = $contactID;
$log->modified_id = $userID;
$log->modified_date = date("YmdHis");
$log->data = $logData;
$log->save();
} else {
$query = "\nUPDATE civicrm_log\n SET data = concat( data, ':{$logData}' )\n WHERE id = {$log->id}\n";
CRM_Core_DAO::executeQuery($query);
}
self::$_processed[$contactID][$userID] = $log->id;
}
示例2: register
static function register($contactID, $tableName, $tableID, $userID = null)
{
if (!self::$_processed) {
self::$_processed = array();
}
if (!$userID) {
$session =& CRM_Core_Session::singleton();
$userID = $session->get('userID');
}
if (!$userID) {
$userID = $contactID;
}
if (!$userID) {
return;
}
$log =& new CRM_Core_DAO_Log();
$log->id = null;
if (isset(self::$_processed[$contactID])) {
if (isset(self::$_processed[$contactID][$userID])) {
$log->id = self::$_processed[$contactID][$userID];
}
self::$_processed[$contactID][$userID] = 1;
} else {
self::$_processed[$contactID] = array($userID => 1);
}
$logData = "{$tableName},{$tableID}";
if (!$log->id) {
$log->entity_table = 'civicrm_contact';
$log->entity_id = $contactID;
$log->modified_id = $userID;
$log->modified_date = date("YmdHis");
$log->data = $logData;
$log->save();
} else {
$query = "\nUPDATE civicrm_log\n SET data = concat( data, ':{$logData}' )\n WHERE id = {$log->id}\n";
CRM_Core_DAO::executeQuery($query);
}
self::$_processed[$contactID][$userID] = $log->id;
}