From 8f5dc4638ef7378db6572aae23b524b8b5a6a1fe Mon Sep 17 00:00:00 2001 From: mikl <> Date: Thu, 16 Oct 2008 09:03:39 +0000 Subject: Ticket #891 (changed to non-static method) --- framework/Data/ActiveRecord/TActiveRecord.php | 4 ++-- framework/Data/ActiveRecord/TActiveRecordGateway.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'framework/Data/ActiveRecord') diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php index f3932849..6a27acb4 100644 --- a/framework/Data/ActiveRecord/TActiveRecord.php +++ b/framework/Data/ActiveRecord/TActiveRecord.php @@ -129,11 +129,11 @@ Prado::using('System.Data.ActiveRecord.Relations.TActiveRecordRelationContext'); * } * * - * Since v3.1.3 you can also define a static method that returns the table name. + * Since v3.1.3 you can also define a method that returns the table name. * * class UserRecord extends TActiveRecord * { - * public static function table() + * public function table() * { * return 'users'; * } diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php index 112ec3e8..250fdd5f 100644 --- a/framework/Data/ActiveRecord/TActiveRecordGateway.php +++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php @@ -72,7 +72,7 @@ class TActiveRecordGateway extends TComponent } elseif ($class->hasMethod(self::TABLE_METHOD)) { - $value = call_user_func(array(get_class($record),self::TABLE_METHOD)); + $value = $record->{self::TABLE_METHOD}(); if(empty($value)) throw new TActiveRecordException('ar_invalid_tablename_method', get_class($record),self::TABLE_METHOD); -- cgit v1.2.3