summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--demos/quickstart/protected/pages/Database/ActiveRecord.page4
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php4
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordGateway.php2
3 files changed, 5 insertions, 5 deletions
diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page
index d54290ab..bc0df529 100644
--- a/demos/quickstart/protected/pages/Database/ActiveRecord.page
+++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page
@@ -130,12 +130,12 @@ You may specify qualified table names. E.g. for MySQL, <tt>TABLE = "`database1`.
</div>
<div class="note"><b class="note">Note:</b>
-Since version <b>3.1.3</b> you can also use a static method to define the table name.
+Since version <b>3.1.3</b> you can also use a method <tt>table()</tt> to define the table name.
This allows you to dynamically specify which table should be used by the ActiveRecord.
<com:TTextHighlighter Language="php" CssClass="source block-content">
class TeamRecord extends TActiveRecord
{
- public static function table() {
+ public function table() {
return 'Teams';
}
}
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');
* }
* </code>
*
- * 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.
* <code>
* 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);