diff --git a/lib/Doctrine/Hydrate/Array.php b/lib/Doctrine/Hydrate/Array.php index 8940064c2..7c7f5dbaf 100644 --- a/lib/Doctrine/Hydrate/Array.php +++ b/lib/Doctrine/Hydrate/Array.php @@ -40,6 +40,10 @@ class Doctrine_Hydrate_Array public function getElement(array $data, $component) { return $data; + } + public function registerCollection($coll) + { + } public function flush() { diff --git a/lib/Doctrine/Hydrate/Record.php b/lib/Doctrine/Hydrate/Record.php index 3d08e788e..896b2f0e8 100644 --- a/lib/Doctrine/Hydrate/Record.php +++ b/lib/Doctrine/Hydrate/Record.php @@ -44,6 +44,15 @@ class Doctrine_Hydrate_Record return $coll; } + public function registerCollection($coll) + { + + if ( ! is_object($coll)) { + throw new Exception(); + } + $this->_collections[] = $coll; + + } public function getElement(array $data, $component) { $record = new $component(); @@ -56,8 +65,8 @@ class Doctrine_Hydrate_Record public function flush() { // take snapshots from all initialized collections - foreach (array_unique($this->_collections) as $c) { - $c->takeSnapshot(); + foreach (array_unique($this->_collections) as $key => $coll) { + $coll->takeSnapshot(); } foreach ($this->_records as $record) {