From 104100cccd4e7b30ec84ed055fb78745dd94b5b0 Mon Sep 17 00:00:00 2001
From: mikl <>
Date: Thu, 16 Oct 2008 08:46:57 +0000
Subject: Ticket #891 (new static method table() in TActiveRecord)
---
framework/Data/ActiveRecord/TActiveRecord.php | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
(limited to 'framework/Data/ActiveRecord/TActiveRecord.php')
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php
index 4e6fd134..f3932849 100644
--- a/framework/Data/ActiveRecord/TActiveRecord.php
+++ b/framework/Data/ActiveRecord/TActiveRecord.php
@@ -79,7 +79,7 @@ Prado::using('System.Data.ActiveRecord.Relations.TActiveRecordRelationContext');
* 'email_address'=>'email',
* );
* public $username;
- * pulbic $email;
+ * public $email;
* }
*
* In the above, the 'users' table consists of 'user_id' and 'email_address' columns,
@@ -129,6 +129,18 @@ Prado::using('System.Data.ActiveRecord.Relations.TActiveRecordRelationContext');
* }
*
*
+ * Since v3.1.3 you can also define a static method that returns the table name.
+ *
+ * class UserRecord extends TActiveRecord
+ * {
+ * public static function table()
+ * {
+ * return 'users';
+ * }
+ *
+ * }
+ *
+ *
* @author Wei Zhuo
* @version $Id$
* @package System.Data.ActiveRecord
--
cgit v1.2.3