2
0
Преглед на файлове

[ZF-9615] Move DbTable adapter seeding

Forward port of r25118 from trunk


git-svn-id: http://framework.zend.com/svn/framework/standard/branches/release-1.12@25119 44c647ce-9c0f-0410-b52a-842ac1e357ba
matthew преди 13 години
родител
ревизия
4db6fb37eb
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      library/Zend/Application/Resource/Db.php

+ 3 - 3
library/Zend/Application/Resource/Db.php

@@ -139,6 +139,9 @@ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbs
         if ((null === $this->_db)
         if ((null === $this->_db)
             && (null !== ($adapter = $this->getAdapter()))
             && (null !== ($adapter = $this->getAdapter()))
         ) {
         ) {
+            if ($this->isDefaultTableAdapter()) {
+                Zend_Db_Table::setDefaultAdapter($adapter);
+            }
             $this->_db = Zend_Db::factory($adapter, $this->getParams());
             $this->_db = Zend_Db::factory($adapter, $this->getParams());
         }
         }
         return $this->_db;
         return $this->_db;
@@ -152,9 +155,6 @@ class Zend_Application_Resource_Db extends Zend_Application_Resource_ResourceAbs
     public function init()
     public function init()
     {
     {
         if (null !== ($db = $this->getDbAdapter())) {
         if (null !== ($db = $this->getDbAdapter())) {
-            if ($this->isDefaultTableAdapter()) {
-                Zend_Db_Table::setDefaultAdapter($db);
-            }
             return $db;
             return $db;
         }
         }
     }
     }