Refactoring Eloquent.

This commit is contained in:
Taylor Otwell
2011-07-08 08:00:04 -07:00
parent c4eb994fbc
commit 7af9e08a60

View File

@@ -369,12 +369,7 @@ abstract class Eloquent {
{ {
$model = $this->$key(); $model = $this->$key();
if (in_array($this->relating, array('has_one', 'belongs_to'))) return $this->ignore[$key] = (in_array($this->relating, array('has_one', 'belongs_to'))) ? $model->first() : $model->get();
{
return $this->ignore[$key] = $model->first();
}
return $this->ignore[$key] = $model->get();
} }
return (array_key_exists($key, $this->attributes)) ? $this->attributes[$key] : null; return (array_key_exists($key, $this->attributes)) ? $this->attributes[$key] : null;