From 1d729693961dfa4cf4da45a05d703b392dbcb47f Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Sun, 12 Jan 2014 23:45:18 +0100 Subject: Quickstart Doc overhaul, pt. 2: active controls + minor fixes --- demos/quickstart/protected/pages/Database/ActiveRecord.page | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'demos/quickstart/protected/pages/Database/ActiveRecord.page') diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page index 537c65e0..cf1485bd 100755 --- a/demos/quickstart/protected/pages/Database/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page @@ -129,7 +129,7 @@ You may specify qualified table names. E.g. for MySQL, TABLE = "`database1`.
Note: -Since version 3.1.3 you can also use a method table() to define the table name. +Since version 3.1.3 you can also use a method table() to define the table name. This allows you to dynamically specify which table should be used by the ActiveRecord. class TeamRecord extends TActiveRecord @@ -159,7 +159,7 @@ class UserRecord extends TActiveRecord { } } -

More details regarding TComponent can be found in the Components documentation. +

More details regarding TComponent can be found in the Components documentation. Later we shall use the getter/setters to allow for lazy loading of relationship objects.

@@ -1128,7 +1128,7 @@ class PlayerRecord extends BaseFkRecord

We first need to change the $skills=array() declaration to a private property $_skills (notice the underscore) and set it to null instead. This allows us to define the skills property using getter/setter methods -(see Components for details). The getSkills() +(see Components for details). The getSkills() getter method for the skills property will lazy load the corresponding skills foreign record when it is used as follows. Notice that we only do a lazy load when its $player_id is not null (that is, when the record is already fetched from the database or player id was already set). -- cgit v1.2.3