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


PHP Zend_Db_Select::setIntegrityCheck方法代码示例

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


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

示例1: _applySelect

 protected function _applySelect(Zend_Db_Select $dbSelect, Kwf_Model_Select $select)
 {
     if ($dbSelect instanceof Zend_Db_Table_Select) {
         $dbSelect->setIntegrityCheck(false);
     }
     if ($whereEquals = $select->getPart(Kwf_Model_Select::WHERE_EQUALS)) {
         foreach ($whereEquals as $field => $value) {
             if (is_array($value)) {
                 if ($value) {
                     foreach ($value as &$v) {
                         if (!is_int($v)) {
                             $v = $this->_fixStupidQuoteBug($v);
                             $v = $this->getAdapter()->quote($v);
                         }
                     }
                     $value = implode(', ', $value);
                     $dbSelect->where($this->_formatField($field, $dbSelect) . " IN ({$value})");
                 } else {
                     $dbSelect->where('0');
                 }
             } else {
                 $value = $this->_fixStupidQuoteBug($value);
                 $dbSelect->where($this->_formatField($field, $dbSelect) . " = ?", $value);
             }
         }
     }
     if ($whereNotEquals = $select->getPart(Kwf_Model_Select::WHERE_NOT_EQUALS)) {
         foreach ($whereNotEquals as $field => $value) {
             if (is_array($value)) {
                 foreach ($value as &$v) {
                     if (!is_int($v)) {
                         $v = $this->_fixStupidQuoteBug($v);
                         $v = $this->getAdapter()->quote($v);
                     }
                 }
                 $value = implode(', ', $value);
                 $dbSelect->where($this->_formatField($field, $dbSelect) . " NOT IN ({$value})");
             } else {
                 $value = $this->_fixStupidQuoteBug($value);
                 $dbSelect->where($this->_formatField($field, $dbSelect) . " != ?", $value);
             }
         }
     }
     if ($this->_hasDeletedFlag && !$select->getPart(Kwf_Model_Select::IGNORE_DELETED)) {
         $dbSelect->where("deleted = 0");
     }
     if ($where = $select->getPart(Kwf_Model_Select::WHERE)) {
         foreach ($where as $w) {
             $dbSelect->where($w[0], $w[1], $w[2]);
         }
     }
     if ($whereId = $select->getPart(Kwf_Model_Select::WHERE_ID)) {
         $whereId = $this->_fixStupidQuoteBug($whereId);
         $dbSelect->where($this->_formatField($this->getPrimaryKey(), $dbSelect) . " = ?", $whereId);
     }
     if ($whereNull = $select->getPart(Kwf_Model_Select::WHERE_NULL)) {
         foreach ($whereNull as $field) {
             $dbSelect->where("ISNULL(" . $this->_formatField($field, $dbSelect) . ")");
         }
     }
     if ($other = $select->getPart(Kwf_Model_Select::OTHER)) {
         foreach ($other as $i) {
             call_user_func_array(array($dbSelect, $i['method']), $i['arguments']);
         }
     }
     if ($whereExpression = $select->getPart(Kwf_Model_Select::WHERE_EXPRESSION)) {
         foreach ($whereExpression as $expr) {
             $expr->validate();
             $dbSelect->where($this->_createDbSelectExpression($expr, $dbSelect));
         }
     }
     if ($exprs = $select->getPart(Kwf_Model_Select::EXPR)) {
         foreach ($exprs as $field) {
             if (!($col = $this->_formatField($field, $dbSelect))) {
                 throw new Kwf_Exception("Expression '{$field}' not found");
             }
             $dbSelect->from(null, array($field => new Zend_Db_Expr($col)));
         }
     }
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:80,代码来源:Db.php


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