瀏覽代碼

[ZF-5970]Optimize Zend_Db_Table::find();

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@15658 44c647ce-9c0f-0410-b52a-842ac1e357ba
yoshida@zend.co.jp 16 年之前
父節點
當前提交
04ae26e6b4
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      library/Zend/Db/Table/Abstract.php

+ 2 - 2
library/Zend/Db/Table/Abstract.php

@@ -77,7 +77,7 @@ abstract class Zend_Db_Table_Abstract
 
 
     const SELECT_WITH_FROM_PART    = true;
     const SELECT_WITH_FROM_PART    = true;
     const SELECT_WITHOUT_FROM_PART = false;
     const SELECT_WITHOUT_FROM_PART = false;
-    
+
     /**
     /**
      * Default Zend_Db_Adapter_Abstract object.
      * Default Zend_Db_Adapter_Abstract object.
      *
      *
@@ -1167,11 +1167,11 @@ abstract class Zend_Db_Table_Abstract
         $whereClause = null;
         $whereClause = null;
         if (count($whereList)) {
         if (count($whereList)) {
             $whereOrTerms = array();
             $whereOrTerms = array();
+            $tableName = $this->_db->quoteTableAs($this->_name, null, true);
             foreach ($whereList as $keyValueSets) {
             foreach ($whereList as $keyValueSets) {
                 $whereAndTerms = array();
                 $whereAndTerms = array();
                 foreach ($keyValueSets as $keyPosition => $keyValue) {
                 foreach ($keyValueSets as $keyPosition => $keyValue) {
                     $type = $this->_metadata[$keyNames[$keyPosition]]['DATA_TYPE'];
                     $type = $this->_metadata[$keyNames[$keyPosition]]['DATA_TYPE'];
-                    $tableName = $this->_db->quoteTableAs($this->_name, null, true);
                     $columnName = $this->_db->quoteIdentifier($keyNames[$keyPosition], true);
                     $columnName = $this->_db->quoteIdentifier($keyNames[$keyPosition], true);
                     $whereAndTerms[] = $this->_db->quoteInto(
                     $whereAndTerms[] = $this->_db->quoteInto(
                         $tableName . '.' . $columnName . ' = ?',
                         $tableName . '.' . $columnName . ' = ?',