fixed attribute setting bug in hydrator.

This commit is contained in:
Taylor Otwell 2011-06-18 10:02:18 -05:00
parent c751844aab
commit 8a4db9ff2d
1 changed files with 4 additions and 2 deletions

View File

@ -49,8 +49,9 @@ private static function base($class, $results)
foreach ($results as $result) foreach ($results as $result)
{ {
$model = new $class((array) $result); $model = new $class;
$model->attributes = (array) $result;
$model->exists = true; $model->exists = true;
// ----------------------------------------------------- // -----------------------------------------------------
@ -240,8 +241,9 @@ private static function eagerly_load_many_to_many($relationship, &$parents, $rel
// ----------------------------------------------------- // -----------------------------------------------------
foreach ($children as $child) foreach ($children as $child)
{ {
$related = new $class((array) $child); $related = new $class;
$related->attributes = (array) $child;
$related->exists = true; $related->exists = true;
// ----------------------------------------------------- // -----------------------------------------------------