From 144117c0a157a0df422cc3f91f3aa4fc7cb062f3 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Thu, 29 Mar 2012 16:58:08 -0500 Subject: [PATCH] cleaning up the eloquent model class. --- laravel/database/eloquent/model.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/laravel/database/eloquent/model.php b/laravel/database/eloquent/model.php index 0bcda60f..efc493b2 100644 --- a/laravel/database/eloquent/model.php +++ b/laravel/database/eloquent/model.php @@ -662,10 +662,12 @@ public function __unset($key) */ public function __call($method, $parameters) { + $meta = array('key', 'table', 'connection', 'sequence', 'per_page'); + // If the method is actually the name of a static property on the model we'll // return the value of the static property. This makes it convenient for // relationships to access these values off of the instances. - if (in_array($method, array('key', 'table', 'connection', 'sequence', 'per_page'))) + if (in_array($method, $meta)) { return static::$$method; }