From d72c9a23cdb415c0ea8066427877e4f6e0dea6f0 Mon Sep 17 00:00:00 2001 From: zYne Date: Thu, 14 Jun 2007 21:50:12 +0000 Subject: [PATCH] fixes #345 --- lib/Doctrine/Connection.php | 47 +--------------------------------- lib/Doctrine/EventListener.php | 5 ++++ 2 files changed, 6 insertions(+), 46 deletions(-) diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index 037a6c09f..9f3246de9 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -37,7 +37,7 @@ Doctrine::autoload('Doctrine_Configurable'); * (for example when query() is being called) * * 3. Convenience methods - * Doctrine_Connection provides many convenience methods. + * Doctrine_Connection provides many convenience methods such as fetchAll(), fetchOne() etc. * * 4. Modular structure * Higher level functionality such as schema importing, exporting, sequence handling etc. @@ -903,51 +903,6 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun $this->tables[$name] = $table; - if ($allowExport) { - - // the following is an algorithm for loading all - // the related tables for all loaded tables - - $next = count($this->tables); - $prev = count($this->exported); - $stack = $this->exported; - while ($prev < $next) { - $prev = count($this->tables); - - foreach($this->tables as $name => $tableObject) { - if (isset($stack[$name])) { - continue; - } else { - $stack[$name] = true; - } - - $tableObject->getRelations(); - } - $next = count($this->tables); - } - - - // when all the tables are loaded we build the array in which the order of the tables is - // relationally correct so that then those can be created in the given order) - - $names = array_keys($this->tables); - - $names = $this->unitOfWork->buildFlushTree($names); - - foreach($names as $name) { - $tableObject = $this->tables[$name]; - - if (isset($this->exported[$name])) { - continue; - } - - if ($tableObject->getAttribute(Doctrine::ATTR_EXPORT) & Doctrine::EXPORT_TABLES) { - - $tableObject->export(); - } - $this->exported[$name] = true; - } - } return $table; } diff --git a/lib/Doctrine/EventListener.php b/lib/Doctrine/EventListener.php index 0b41066e0..57f02eccb 100644 --- a/lib/Doctrine/EventListener.php +++ b/lib/Doctrine/EventListener.php @@ -93,6 +93,11 @@ class Doctrine_EventListener implements Doctrine_EventListener_Interface public function onOpen(Doctrine_Connection $connection) { } + public function onConnect(Doctrine_Connection $connection) + { } + public function onPreConnect(Doctrine_Connection $connection) + { } + public function onTransactionCommit(Doctrine_Connection $connection) { } public function onPreTransactionCommit(Doctrine_Connection $connection)