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


PHP Field::buildDSRetrievalSQL方法代码示例

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


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

示例1: buildDSRetrievalSQL

 public function buildDSRetrievalSQL($data, &$joins, &$where, $andOperation = false)
 {
     // X to Y support
     if (preg_match('/^(-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)) to (-?(?:\\d+(?:\\.\\d+)?|\\.\\d+))$/i', $data[0], $match)) {
         $field_id = $this->get('id');
         $joins .= " LEFT JOIN `tbl_entries_data_{$field_id}` AS `t{$field_id}` ON (`e`.`id` = `t{$field_id}`.entry_id) ";
         $where .= " AND `t{$field_id}`.`value` BETWEEN {$match[1]} AND {$match[2]} ";
     } else {
         if (preg_match('/^(equal to or )?(less|greater) than (-?(?:\\d+(?:\\.\\d+)?|\\.\\d+))$/i', $data[0], $match)) {
             $field_id = $this->get('id');
             $expression = " `t{$field_id}`.`value` ";
             switch ($match[2]) {
                 case 'less':
                     $expression .= '<';
                     break;
                 case 'greater':
                     $expression .= '>';
                     break;
             }
             if ($match[1]) {
                 $expression .= '=';
             }
             $expression .= " {$match[3]} ";
             $joins .= " LEFT JOIN `tbl_entries_data_{$field_id}` AS `t{$field_id}` ON (`e`.`id` = `t{$field_id}`.entry_id) ";
             $where .= " AND {$expression} ";
         } else {
             parent::buildDSRetrievalSQL($data, $joins, $where, $andOperation);
         }
     }
     return true;
 }
开发者ID:mblabs,项目名称:incrementnumberfield,代码行数:31,代码来源:field.incrementnumber.php

示例2: buildDSRetrievalSQL

 function buildDSRetrievalSQL($data, &$joins, &$where, $andOperation = false)
 {
     // Check its not a regexp
     if (preg_match('/^mysql:/i', $data[0])) {
         $field_id = $this->get('id');
         $expression = str_replace(array('mysql:', 'value'), array('', " `t{$field_id}`.`value` "), $data[0]);
         $joins .= " LEFT JOIN `tbl_entries_data_{$field_id}` AS `t{$field_id}` ON (`e`.`id` = `t{$field_id}`.entry_id) ";
         $where .= " AND {$expression} ";
     } else {
         parent::buildDSRetrievalSQL($data, $joins, $where, $andOperation);
     }
     return true;
 }
开发者ID:hotdoy,项目名称:EDclock,代码行数:13,代码来源:field.order_entries.php

示例3: buildDSRetrievalSQL

 public function buildDSRetrievalSQL($data, &$joins, &$where, $andOperation = false)
 {
     if (self::isFilterRegex($data[0])) {
         return parent::buildDSRetrievalSQL($data, $joins, $where, $andOperation);
     }
     $parsed = array();
     foreach ($data as $string) {
         $type = self::parseFilter($string);
         if ($type == self::ERROR) {
             return false;
         }
         if (!is_array($parsed[$type])) {
             $parsed[$type] = array();
         }
         $parsed[$type][] = $string;
     }
     foreach ($parsed as $type => $value) {
         switch ($type) {
             case self::RANGE:
                 $this->buildRangeFilterSQL($value, $joins, $where, $andOperation);
                 break;
             case self::SIMPLE:
                 $this->buildSimpleFilterSQL($value, $joins, $where, $andOperation);
                 break;
         }
     }
     return true;
 }
开发者ID:scottkf,项目名称:keepflippin--on-symphony,代码行数:28,代码来源:field.date.php

示例4: buildDSRetrievalSQL

 public function buildDSRetrievalSQL($data, &$joins, &$where, $andOperation = false)
 {
     if (self::isFilterRegex($data[0])) {
         return parent::buildDSRetrievalSQL($data, $joins, $where, $andOperation);
     }
     $parsed = array();
     // For the filter provided, loop over each piece
     foreach ($data as $string) {
         $type = self::parseFilter($string);
         if ($type == self::ERROR) {
             return false;
         }
         if (!is_array($parsed[$type])) {
             $parsed[$type] = array();
         }
         $parsed[$type][] = $string;
     }
     foreach ($parsed as $value) {
         $this->buildRangeFilterSQL($value, $joins, $where, $andOperation);
     }
     return true;
 }
开发者ID:shobhalakshminarayana,项目名称:Bugaroo,代码行数:22,代码来源:field.date.php


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