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


PHP SelectQuery::condition方法代码示例

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


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

示例1: hook_query_rules_autotag_terms_alter

/**
 * Alter the term DB query.
 *
 * @param SelectQuery $query
 *   The query object ot alter.
 */
function hook_query_rules_autotag_terms_alter($query)
{
    // Join the original term query from rules_autotag with our field table to
    // exclude terms that should not be tagged.
    $query->leftJoin('field_data_field_dont_autotag', 'fd', "t.tid = fd.entity_id AND fd.entity_type = 'taxonomy_term'");
    $query->condition(db_or()->condition('fd.field_dont_autotag_value', NULL)->condition('fd.field_dont_autotag_value', '1', '<>'));
}
开发者ID:agroknow,项目名称:agreri,代码行数:13,代码来源:rules_autotag.api.php

示例2: queryForListFilter

 /**
  * Filter the query for list.
  *
  * @param \SelectQuery $query
  *   The query object.
  *
  * @throws BadRequestException
  *
  * @see \RestfulEntityBase::getQueryForList
  */
 protected function queryForListFilter(\SelectQuery $query)
 {
     foreach ($this->parseRequestForListFilter() as $filter) {
         /* @var ResourceFieldDbColumnInterface $filter_field */
         if (!($filter_field = $this->fieldDefinitions->get($filter['public_field']))) {
             continue;
         }
         $column_name = $filter_field->getColumnForQuery();
         if (in_array(strtoupper($filter['operator'][0]), array('IN', 'NOT IN', 'BETWEEN'))) {
             $query->condition($column_name, $filter['value'], $filter['operator'][0]);
             continue;
         }
         $condition = db_condition($filter['conjunction']);
         for ($index = 0; $index < count($filter['value']); $index++) {
             $condition->condition($column_name, $filter['value'][$index], $filter['operator'][$index]);
         }
         $query->condition($condition);
     }
 }
开发者ID:jhoffman-tm,项目名称:waldorf-deployment,代码行数:29,代码来源:DataProviderDbQuery.php

示例3: condition

 public function condition($field, $value = null, $operator = null)
 {
     Internal\condition_hook($field, $value, $operator);
     return parent::condition($field, $value, $operator);
 }
开发者ID:zevergreenz,项目名称:Drupal,代码行数:5,代码来源:cvwobase_d7_db_api2.php

示例4: queryForListFilter

 /**
  * Filter the query for list.
  *
  * @param \SelectQuery $query
  *   The query object.
  *
  * @throws \RestfulBadRequestException
  *
  * @see \RestfulEntityBase::getQueryForList
  */
 protected function queryForListFilter(\SelectQuery $query) {
   $public_fields = $this->getPublicFields();
   foreach ($this->parseRequestForListFilter() as $filter) {
     if (in_array(strtoupper($filter['operator'][0]), array('IN', 'BETWEEN'))) {
       $column_name = $this->getPropertyColumnForQuery($public_fields[$filter['public_field']]);
       $query->condition($column_name, $filter['value'], $filter['operator'][0]);
       continue;
     }
     $condition = db_condition($filter['conjunction']);
     for ($index = 0; $index < count($filter['value']); $index++) {
       $column_name = $this->getPropertyColumnForQuery($public_fields[$filter['public_field']]);
       $condition->condition($column_name, $filter['value'][$index], $filter['operator'][$index]);
     }
     $query->condition($condition);
   }
 }
开发者ID:pcambra,项目名称:site,代码行数:26,代码来源:RestfulDataProviderDbQuery.php

示例5: condition

 /**
  * @param string $field
  * @param string|array $value
  * @param string $operator
  *
  * @return $this
  */
 public function condition($field, $value = null, $operator = null)
 {
     $this->query->condition($field, $value, $operator);
     return $this;
 }
开发者ID:BR0kEN-,项目名称:TqExtension,代码行数:12,代码来源:FetchField.php

示例6: setCondition

 public function setCondition($column, $value)
 {
     $this->selectQuery->condition($column, $value);
 }
开发者ID:itarato,项目名称:micmod,代码行数:4,代码来源:SelectQueryEngine.php

示例7: hook_node_limit_sql

/**
 * Improve node limit count request.
 * 
 * Called when counting nodes to know if a limit has been reached.
 * 
 * @param int $lid
 *   The node limit id
 * @param SelectQuery $select
 *   The SQL select query
 */
function hook_node_limit_sql($lid, $select)
{
    $limit = submodule_node_limit_load($lid);
    if (empty($limit)) {
        return;
    }
    $select->condition('uid', $limit['submodule']['uid']);
}
开发者ID:faxe-kommune,项目名称:OS2loop,代码行数:18,代码来源:node_limit.api.php


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