From 82432246b9a07ad89b6ada90d38ed85754cbd51f Mon Sep 17 00:00:00 2001 From: romanb Date: Sun, 18 Nov 2007 16:42:33 +0000 Subject: [PATCH] Doctrine_Migration::setTableName now takes the ATTR_TBLNAME_FORMAT into account --- lib/Doctrine/Migration.php | 3 ++- lib/Doctrine/Record.php | 1 - lib/Doctrine/Transaction.php | 8 ++------ tests/ValidatorTestCase.php | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/Doctrine/Migration.php b/lib/Doctrine/Migration.php index 641744b83..80bee21ff 100644 --- a/lib/Doctrine/Migration.php +++ b/lib/Doctrine/Migration.php @@ -90,7 +90,8 @@ class Doctrine_Migration */ public function setTableName($tableName) { - $this->_migrationTableName = $tableName; + $this->_migrationTableName = Doctrine_Manager::connection() + ->formatter->getTableName($tableName); } /** diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php index d51d8f562..2e61396e2 100644 --- a/lib/Doctrine/Record.php +++ b/lib/Doctrine/Record.php @@ -455,7 +455,6 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count */ public function hydrate(array $data) { - $this->_values = array_merge($this->_values, $this->cleanData($data)); $this->_data = array_merge($this->_data, $data); //Doctrine::dump($this->_data); diff --git a/lib/Doctrine/Transaction.php b/lib/Doctrine/Transaction.php index e3263516a..68b6e9e9d 100644 --- a/lib/Doctrine/Transaction.php +++ b/lib/Doctrine/Transaction.php @@ -248,18 +248,14 @@ class Doctrine_Transaction extends Doctrine_Connection_Module } $listener->postSavepointCommit($event); - } else { - - if ($this->transactionLevel == 1) { + } else { + if ($this->transactionLevel == 1) { if ( ! empty($this->invalid)) { $this->rollback(); - $tmp = $this->invalid; $this->invalid = array(); - throw new Doctrine_Validator_Exception($tmp); } - // take snapshots of all collections used within this transaction foreach ($this->_collections as $coll) { $coll->takeSnapshot(); diff --git a/tests/ValidatorTestCase.php b/tests/ValidatorTestCase.php index 4eb270247..0d9e48640 100644 --- a/tests/ValidatorTestCase.php +++ b/tests/ValidatorTestCase.php @@ -216,7 +216,7 @@ class Doctrine_Validator_TestCase extends Doctrine_UnitTestCase $user->name = "this is an example of too long user name not very good example but an example nevertheless"; $user->save(); $this->fail(); - } catch(Doctrine_Validator_Exception $e) { + } catch (Doctrine_Validator_Exception $e) { $this->pass(); $a = $e->getInvalidRecords(); //var_dump($a[1]->getErrorStack());