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


PHP Kwf_Model_Select::merge方法代码示例

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


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

示例1: _convertSelect

 private function _convertSelect($select, $modelKey, $m)
 {
     $s = new Kwf_Model_Select();
     if ($p = $select->getPart(Kwf_Model_Select::WHERE_ID)) {
         if (substr($p, 0, strlen($modelKey)) == $modelKey) {
             $s->whereId(substr($p, strlen($modelKey)));
         } else {
             return null;
         }
     }
     if ($p = $select->getPart(Kwf_Model_Select::WHERE_EQUALS)) {
         foreach ($p as $f => $v) {
             if ($f == 'id') {
                 if (is_array($v)) {
                     $filterV = array();
                     foreach ($v as $i) {
                         if (substr($i, 0, strlen($modelKey)) == $modelKey) {
                             $filterV[] = substr($i, strlen($modelKey));
                         }
                     }
                     if (!$filterV) {
                         return null;
                     }
                     $v = $filterV;
                 } else {
                     if (substr($v, 0, strlen($modelKey)) == $modelKey) {
                         $v = substr($v, strlen($modelKey));
                     } else {
                         return null;
                     }
                 }
             }
             if (in_array($f, $this->_getOwnColumns())) {
                 $f = $this->_mapColumn($m, $f);
                 $s->whereEquals($f, $v);
             }
         }
     }
     if ($p = $select->getPart(Kwf_Model_Select::WHERE_NOT_EQUALS)) {
         foreach ($p as $f => $v) {
             if ($f == 'id') {
                 if (substr($v, 0, strlen($modelKey)) != $modelKey) {
                     continue;
                 } else {
                     $v = substr($v, strlen($modelKey));
                 }
             }
             if (in_array($f, $this->_getOwnColumns())) {
                 $f = $this->_mapColumn($m, $f);
                 $s->whereNotEquals($f, $v);
             }
         }
     }
     if ($p = $select->getPart(Kwf_Model_Select::WHERE_NULL)) {
         foreach ($p as $f) {
             if (in_array($f, $this->_getOwnColumns())) {
                 $f = $this->_mapColumn($m, $f);
                 $s->whereNull($f);
             }
         }
     }
     if ($p = $select->getPart(Kwf_Model_Select::WHERE_EXPRESSION)) {
         foreach ($p as $expr) {
             $e = $this->_convertExpr($expr, $modelKey, $m);
             if ($e) {
                 $s->where($e);
             }
         }
     }
     if ($p = $select->getPart(Kwf_Model_Select::IGNORE_DELETED)) {
         $s->ignoreDeleted($p);
     }
     if (isset($this->_mergeSelects[$modelKey])) {
         $s->merge($this->_mergeSelects[$modelKey]);
     }
     return $s;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:77,代码来源:Union.php


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