Commit 0003c233 authored by Jonathan.Wage's avatar Jonathan.Wage

Fix to fromArray()

parent 563377cc
...@@ -651,7 +651,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator ...@@ -651,7 +651,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
public function toArray($deep = false, $prefixKey = false) public function toArray($deep = false, $prefixKey = false)
{ {
$data = array(); $data = array();
foreach ($this->data as $key => $record) { foreach ($this as $key => $record) {
$key = $prefixKey ? get_class($record) . '_' .$key:$key; $key = $prefixKey ? get_class($record) . '_' .$key:$key;
...@@ -667,10 +667,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator ...@@ -667,10 +667,8 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
$record = $this->_table->getRecord(); $record = $this->_table->getRecord();
$record->fromArray($row); $record->fromArray($row);
$data[] = $record; $this[] = $record;
} }
$this->data = $data;
} }
public function exportTo($type, $deep = false) public function exportTo($type, $deep = false)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment