当前位置: 首页>>代码示例>>PHP>>正文


PHP CRM_Dedupe_BAO_Rule::orderBy方法代码示例

本文整理汇总了PHP中CRM_Dedupe_BAO_Rule::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Dedupe_BAO_Rule::orderBy方法的具体用法?PHP CRM_Dedupe_BAO_Rule::orderBy怎么用?PHP CRM_Dedupe_BAO_Rule::orderBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CRM_Dedupe_BAO_Rule的用法示例。


在下文中一共展示了CRM_Dedupe_BAO_Rule::orderBy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: tableQuery

 /**
  * Return a set of SQL queries whose cummulative weights will mark matched
  * records for the RuleGroup::threasholdQuery() to retrieve.
  */
 public function tableQuery()
 {
     // make sure we've got a fetched dbrecord, not sure if this is enforced
     if (!$this->name == NULL || $this->is_reserved == NULL) {
         $this->find(TRUE);
     }
     // Reserved Rule Groups can optionally get special treatment by
     // implementing an optimization class and returning a query array.
     if ($this->is_reserved && CRM_Utils_File::isIncludable("CRM/Dedupe/BAO/QueryBuilder/{$this->name}.php")) {
         include_once "CRM/Dedupe/BAO/QueryBuilder/{$this->name}.php";
         $class = "CRM_Dedupe_BAO_QueryBuilder_{$this->name}";
         $command = empty($this->params) ? 'internal' : 'record';
         $queries = call_user_func(array($class, $command), $this);
     } else {
         // All other rule groups have queries generated by the member dedupe
         // rules defined in the administrative interface.
         // Find all rules contained by this script sorted by weight so that
         // their execution can be short circuited on RuleGroup::fillTable()
         $bao = new CRM_Dedupe_BAO_Rule();
         $bao->dedupe_rule_group_id = $this->id;
         $bao->orderBy('rule_weight DESC');
         $bao->find();
         // Generate a SQL query for each rule in the rule group that is
         // tailored to respect the param and contactId options provided.
         $queries = array();
         while ($bao->fetch()) {
             $bao->contactIds = $this->contactIds;
             $bao->params = $this->params;
             // Skipping empty rules? Empty rules shouldn't exist; why check?
             if ($query = $bao->sql()) {
                 $queries["{$bao->rule_table}.{$bao->rule_field}.{$bao->rule_weight}"] = $query;
             }
         }
     }
     // if there are no rules in this rule group
     // add an empty query fulfilling the pattern
     if (!$queries) {
         $queries = array('SELECT 0 id1, 0 id2, 0 weight LIMIT 0');
         $this->noRules = TRUE;
     }
     return $queries;
 }
开发者ID:saurabhbatra96,项目名称:civicrm-core,代码行数:46,代码来源:RuleGroup.php

示例2: tableQuery

 /**
  * Return the SQL query for creating the temporary table.
  */
 function tableQuery()
 {
     require_once 'CRM/Dedupe/BAO/Rule.php';
     $bao = new CRM_Dedupe_BAO_Rule();
     $bao->dedupe_rule_group_id = $this->id;
     $bao->orderBy('rule_weight DESC');
     $bao->find();
     $queries = array();
     while ($bao->fetch()) {
         $bao->contactIds = $this->contactIds;
         $bao->params = $this->params;
         if ($query = $bao->sql()) {
             $queries["{$bao->rule_table}.{$bao->rule_field}.{$bao->rule_weight}"] = $query;
         }
     }
     // if there are no rules in this rule group, add an empty query fulfilling the pattern
     if (!$queries) {
         $queries = array('SELECT 0 id1, 0 id2, 0 weight LIMIT 0');
         $this->noRules = true;
     }
     return $queries;
 }
开发者ID:hampelm,项目名称:Ginsberg-CiviDemo,代码行数:25,代码来源:RuleGroup.php


注:本文中的CRM_Dedupe_BAO_Rule::orderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。