From 8a4db9ff2dc8ffce7b14a3465248480bc12fcdb3 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 18 Jun 2011 10:02:18 -0500 Subject: [PATCH] fixed attribute setting bug in hydrator. --- system/db/eloquent/hydrator.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/system/db/eloquent/hydrator.php b/system/db/eloquent/hydrator.php index 10a26980..ab068fed 100644 --- a/system/db/eloquent/hydrator.php +++ b/system/db/eloquent/hydrator.php @@ -49,8 +49,9 @@ private static function base($class, $results) foreach ($results as $result) { - $model = new $class((array) $result); + $model = new $class; + $model->attributes = (array) $result; $model->exists = true; // ----------------------------------------------------- @@ -240,8 +241,9 @@ private static function eagerly_load_many_to_many($relationship, &$parents, $rel // ----------------------------------------------------- foreach ($children as $child) { - $related = new $class((array) $child); + $related = new $class; + $related->attributes = (array) $child; $related->exists = true; // -----------------------------------------------------