當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Dedupe_BAO_RuleGroup::tableDropQuery方法代碼示例

本文整理匯總了PHP中CRM_Dedupe_BAO_RuleGroup::tableDropQuery方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Dedupe_BAO_RuleGroup::tableDropQuery方法的具體用法?PHP CRM_Dedupe_BAO_RuleGroup::tableDropQuery怎麽用?PHP CRM_Dedupe_BAO_RuleGroup::tableDropQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Dedupe_BAO_RuleGroup的用法示例。


在下文中一共展示了CRM_Dedupe_BAO_RuleGroup::tableDropQuery方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: dupesByParams

 /**
  * Return an array of possible dupes, based on the provided array of
  * params, using the default rule group for the given contact type and
  * level.
  *
  * check_permission is a boolean flag to indicate if permission should be considered.
  * default is to always check permissioning but public pages for example might not want
  * permission to be checked for anonymous users. Refer CRM-6211. We might be beaking
  * Multi-Site dedupe for public pages.
  *
  * @param array  $params  array of params of the form $params[$table][$field] == $value
  * @param string $ctype   contact type to match against
  * @param string $level   dedupe rule group level ('Fuzzy' or 'Strict')
  * @param array  $except  array of contacts that shouldn't be considered dupes
  * @param int    $ruleGroupID the id of the dedupe rule we should be using
  *
  * @return array  matching contact ids
  */
 static function dupesByParams($params, $ctype, $level = 'Strict', $except = array(), $ruleGroupID = NULL)
 {
     // If $params is empty there is zero reason to proceed.
     if (!$params) {
         return array();
     }
     $foundByID = FALSE;
     if ($ruleGroupID) {
         $rgBao = new CRM_Dedupe_BAO_RuleGroup();
         $rgBao->id = $ruleGroupID;
         $rgBao->contact_type = $ctype;
         if ($rgBao->find(TRUE)) {
             $foundByID = TRUE;
         }
     }
     if (!$foundByID) {
         $rgBao = new CRM_Dedupe_BAO_RuleGroup();
         $rgBao->contact_type = $ctype;
         $rgBao->level = $level;
         $rgBao->is_default = 1;
         if (!$rgBao->find(TRUE)) {
             CRM_Core_Error::fatal("{$level} rule for {$ctype} does not exist");
         }
     }
     $params['check_permission'] = CRM_Utils_Array::value('check_permission', $params, TRUE);
     $rgBao->params = $params;
     $rgBao->fillTable();
     $dao = new CRM_Core_DAO();
     $dao->query($rgBao->thresholdQuery($params['check_permission']));
     $dupes = array();
     while ($dao->fetch()) {
         if (isset($dao->id) && $dao->id) {
             $dupes[] = $dao->id;
         }
     }
     $dao->query($rgBao->tableDropQuery());
     return array_diff($dupes, $except);
 }
開發者ID:peteainsworth,項目名稱:civicrm-4.2.9-drupal,代碼行數:56,代碼來源:Finder.php


注:本文中的CRM_Dedupe_BAO_RuleGroup::tableDropQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。