From e89a841b002373aecd99e71648475e3ead5eaaf4 Mon Sep 17 00:00:00 2001 From: doctrine Date: Fri, 14 Apr 2006 10:37:13 +0000 Subject: [PATCH] --- classes/Collection/Batch.class.php | 2 -- classes/Record.class.php | 32 +++++++++++++++--------------- tests/run.php | 6 ++++-- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/classes/Collection/Batch.class.php b/classes/Collection/Batch.class.php index 15018447c..d61977294 100644 --- a/classes/Collection/Batch.class.php +++ b/classes/Collection/Batch.class.php @@ -110,7 +110,6 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { while($row = $stmt->fetch(PDO::FETCH_ASSOC)): $this->table->setData($row); - if(is_object($this->data[$e])) { $this->data[$e]->factoryRefresh($this->table); } else { @@ -159,7 +158,6 @@ class Doctrine_Collection_Batch extends Doctrine_Collection { if( ! isset($this->data[$key])) $this->data[$key] = $this->table->create(); - } diff --git a/classes/Record.class.php b/classes/Record.class.php index 356712438..0b77fcf60 100644 --- a/classes/Record.class.php +++ b/classes/Record.class.php @@ -386,28 +386,28 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite if( ! $this->loaded) { - // no use trying to load the data from database if the Doctrine_Record is new or clean - if($this->state != Doctrine_Record::STATE_TDIRTY && - $this->state != Doctrine_Record::STATE_TCLEAN && - $this->state != Doctrine_Record::STATE_CLEAN) { - - $this->loaded = true; - - if( ! empty($this->collections)) { - foreach($this->collections as $collection) { - $collection->load($this); + // no use trying to load the data from database if the Doctrine_Record is new or clean + if($this->state != Doctrine_Record::STATE_TDIRTY && + $this->state != Doctrine_Record::STATE_TCLEAN && + $this->state != Doctrine_Record::STATE_CLEAN) { + + $this->loaded = true; + + if( ! empty($this->collections)) { + foreach($this->collections as $collection) { + $collection->load($this); + } + } else { + + $this->refresh(); } - } else { - - $this->refresh(); + $this->state = Doctrine_Record::STATE_CLEAN; } - $this->state = Doctrine_Record::STATE_CLEAN; } + if(is_array($this->data[$name])) return null; - } - return null; } return $this->data[$name]; } diff --git a/tests/run.php b/tests/run.php index cbb5860b5..56517d6f4 100644 --- a/tests/run.php +++ b/tests/run.php @@ -32,13 +32,15 @@ $test->addTestCase(new Doctrine_ConfigurableTestCase()); $test->addTestCase(new Doctrine_EventListenerTestCase()); -//$test->addTestCase(new Doctrine_BatchIteratorTestCase()); +$test->addTestCase(new Doctrine_DQL_ParserTestCase()); + +$test->addTestCase(new Doctrine_BatchIteratorTestCase()); //$test->addTestCase(new Doctrine_Cache_FileTestCase()); -$test->addTestCase(new Doctrine_DQL_ParserTestCase()); +