From d59dce8607393884adfa1458e94b90e6f104128a Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Fri, 21 Sep 2007 18:34:10 +0000 Subject: [PATCH] Moved save. --- lib/Doctrine/Resource/Collection.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/Doctrine/Resource/Collection.php b/lib/Doctrine/Resource/Collection.php index 2bc5fab91..ca4133751 100644 --- a/lib/Doctrine/Resource/Collection.php +++ b/lib/Doctrine/Resource/Collection.php @@ -22,13 +22,6 @@ class Doctrine_Resource_Collection extends Doctrine_Access implements Countable, return new ArrayIterator($data); } - public function save() - { - foreach ($data as $record) { - $record->save(); - } - } - public function getFirst() { return $this->data[0]; @@ -37,10 +30,17 @@ class Doctrine_Resource_Collection extends Doctrine_Access implements Countable, public function toArray() { $array = array(); - foreach($this->data as $key => $record) { + foreach ($this->data as $key => $record) { $array[$key] = $record->toArray(); } return $array; } + + public function save() + { + foreach ($this->data as $record) { + $record->save(); + } + } } \ No newline at end of file