summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Database
diff options
context:
space:
mode:
authorchristophe.boulain <>2008-12-03 14:22:03 +0000
committerchristophe.boulain <>2008-12-03 14:22:03 +0000
commit6228873cf9d6471463d2413e7dfd7447f759baf2 (patch)
tree496a0e658330c39d4caa35602ba9f783b6f24f9c /demos/quickstart/protected/pages/Database
parente8f239fea7351b248302a593a8e5eaa2a88c3e80 (diff)
Merge from trunk
Diffstat (limited to 'demos/quickstart/protected/pages/Database')
-rw-r--r--demos/quickstart/protected/pages/Database/ActiveRecord.page15
1 files changed, 14 insertions, 1 deletions
diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page
index 70998587..bc0df529 100644
--- a/demos/quickstart/protected/pages/Database/ActiveRecord.page
+++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page
@@ -129,6 +129,19 @@ class UserRecord extends TActiveRecord
You may specify qualified table names. E.g. for MySQL, <tt>TABLE = "`database1`.`table1`"</tt>.
</div>
+<div class="note"><b class="note">Note:</b>
+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 function table() {
+ return 'Teams';
+ }
+}
+</com:TTextHighlighter>
+</div>
+
<p class="block-content" id="ar_as_component">
Since <tt>TActiveRecord</tt> extends <tt>TComponent</tt>, setter and
getter methods can be defined to allow control over how variables
@@ -1183,4 +1196,4 @@ instead of <tt>$userRecord->first_name</tt>. This helps separation of logic and
</ul>
-<div class="last-modified">$Id$</div></com:TContent> \ No newline at end of file
+<div class="last-modified">$Id$</div></com:TContent>