Add some events to Eloquent models.

This commit is contained in:
Taylor Otwell
2012-04-26 09:30:34 -05:00
parent 1f3d269adc
commit ca06582369
4 changed files with 83 additions and 29 deletions

View File

@@ -1,5 +1,6 @@
<?php namespace Laravel\Database\Eloquent;
use Laravel\Event;
use Laravel\Database;
use Laravel\Database\Eloquent\Relationships\Has_Many_And_Belongs_To;
@@ -119,12 +120,7 @@ class Query {
// We need to set the attributes manually in case the accessible property is
// set on the array which will prevent the mass assignemnt of attributes if
// we were to pass them in using the constructor or fill methods.
foreach ($result as $key => $value)
{
$new->set_attribute($key, $value);
}
$new->original = $new->attributes;
$new->fill_raw($result);
$models[] = $new;
}