本文整理匯總了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;
}