From 0003c233d4eb95c515ac8d5fe4152ceda0dd8ab5 Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Thu, 8 Nov 2007 18:53:30 +0000 Subject: [PATCH] Fix to fromArray() --- lib/Doctrine/Collection.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/Collection.php b/lib/Doctrine/Collection.php index a360361a3..d9f8ad670 100644 --- a/lib/Doctrine/Collection.php +++ b/lib/Doctrine/Collection.php @@ -651,7 +651,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator public function toArray($deep = false, $prefixKey = false) { $data = array(); - foreach ($this->data as $key => $record) { + foreach ($this as $key => $record) { $key = $prefixKey ? get_class($record) . '_' .$key:$key; @@ -667,10 +667,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator $record = $this->_table->getRecord(); $record->fromArray($row); - $data[] = $record; + $this[] = $record; } - - $this->data = $data; } public function exportTo($type, $deep = false) {