本文整理汇总了PHP中CRM_Dedupe_BAO_RuleGroup::getContactTypeForRuleGroup方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Dedupe_BAO_RuleGroup::getContactTypeForRuleGroup方法的具体用法?PHP CRM_Dedupe_BAO_RuleGroup::getContactTypeForRuleGroup怎么用?PHP CRM_Dedupe_BAO_RuleGroup::getContactTypeForRuleGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Dedupe_BAO_RuleGroup
的用法示例。
在下文中一共展示了CRM_Dedupe_BAO_RuleGroup::getContactTypeForRuleGroup方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMergeCacheKeyString
/**
* Get the cache key string for the merge action.
*
* @param int $rule_group_id
* @param int $group_id
* @param array $criteria
* Additional criteria to narrow down the merge group.
* Currently we are only supporting the key 'contact' within it.
*
* @param bool $checkPermissions
* Respect the users permissions.
*
* @return string
*/
public static function getMergeCacheKeyString($rule_group_id, $group_id, $criteria = array(), $checkPermissions = TRUE)
{
$contactType = CRM_Dedupe_BAO_RuleGroup::getContactTypeForRuleGroup($rule_group_id);
$cacheKeyString = "merge {$contactType}";
$cacheKeyString .= $rule_group_id ? "_{$rule_group_id}" : '_0';
$cacheKeyString .= $group_id ? "_{$group_id}" : '_0';
$cacheKeyString .= !empty($criteria) ? serialize($criteria) : '_0';
if ($checkPermissions) {
$contactID = CRM_Core_Session::getLoggedInContactID();
if (!$contactID) {
// Distinguish between no permission check & no logged in user.
$contactID = 'null';
}
$cacheKeyString .= '_' . $contactID;
} else {
$cacheKeyString .= '_0';
}
return $cacheKeyString;
}