summaryrefslogtreecommitdiff
path: root/framework/Data/ActiveRecord/TActiveRecord.php
diff options
context:
space:
mode:
authormikl <>2008-10-16 08:46:57 +0000
committermikl <>2008-10-16 08:46:57 +0000
commit104100cccd4e7b30ec84ed055fb78745dd94b5b0 (patch)
tree3d4cef9ed43053dd7d0a861ec32119523ee10e75 /framework/Data/ActiveRecord/TActiveRecord.php
parent710a1d43a1ff0f5449529a13d9a93676fbfb3f5d (diff)
Ticket #891 (new static method table() in TActiveRecord)
Diffstat (limited to 'framework/Data/ActiveRecord/TActiveRecord.php')
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php14
1 files changed, 13 insertions, 1 deletions
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;
* }
* </code>
* 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');
* }
* </code>
*
+ * Since v3.1.3 you can also define a static method that returns the table name.
+ * <code>
+ * class UserRecord extends TActiveRecord
+ * {
+ * public static function table()
+ * {
+ * return 'users';
+ * }
+ *
+ * }
+ * </code>
+ *
* @author Wei Zhuo <weizho[at]gmail[dot]com>
* @version $Id$
* @package System.Data.ActiveRecord