From eda46a815ee7e11116ff025fda8cfca827321472 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 4 Apr 2012 10:33:24 -0500 Subject: [PATCH 1/2] fix eloquent model attribute resolution. --- application/config/application.php | 2 +- laravel/database/eloquent/model.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/config/application.php b/application/config/application.php index 8cbf104a..01f07845 100755 --- a/application/config/application.php +++ b/application/config/application.php @@ -54,7 +54,7 @@ return array( | */ - 'profiler' => true, + 'profiler' => false, /* |-------------------------------------------------------------------------- diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 53ff52c3..3ab50c74 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -698,11 +698,11 @@ abstract class Model { // to perform the appropriate action based on the method. if (starts_with($method, 'get_')) { - return $this->attributes[substr($method, 4)]; + return $this->get_attribute(substr($method, 4)); } elseif (starts_with($method, 'set_')) { - $this->attributes[substr($method, 4)] = $parameters[0]; + $this->set_attribute(substr($method, 4), $parameters[0]); } // Finally we will assume that the method is actually the beginning of a From 250541b22bcc700d426feda64157b315848e51bf Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 4 Apr 2012 10:33:49 -0500 Subject: [PATCH 2/2] updated change log. --- laravel/documentation/changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/laravel/documentation/changes.md b/laravel/documentation/changes.md index 0047ff83..78298186 100644 --- a/laravel/documentation/changes.md +++ b/laravel/documentation/changes.md @@ -28,6 +28,7 @@ - Fixed replacement of optional parameters in URL::transpose method. - Improved View performance by only loading contents from file once. - Fix handling of URLs beginning with has in URL::to. +- Fix the resolution of unset Eloquent attributes. ## Upgrading From 3.1