summaryrefslogtreecommitdiff
path: root/demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php
diff options
context:
space:
mode:
authorwei <>2007-05-10 23:00:04 +0000
committerwei <>2007-05-10 23:00:04 +0000
commite2cb0b52aaa02a3f3f41d0df377d189529713738 (patch)
treeee4c2a3fece40c9a2d4dde75f6e758f7ef05f8f6 /demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php
parentef2fc3942664d4d7131542080e838f7754a3081f (diff)
Update blog tutorial
Diffstat (limited to 'demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php')
-rw-r--r--demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php b/demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php
index a761286a..01f84437 100644
--- a/demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php
+++ b/demos/blog-tutorial/samples/day2/blog/protected/database/PostRecord.php
@@ -6,18 +6,19 @@ class PostRecord extends TActiveRecord
{
const TABLE='posts';
- public $post_id;
-
- public $author;
-
- public $create_time;
-
- public $title;
-
- public $content;
-
- public $status;
+ public $post_id;
+ public $author_id;
+ public $create_time;
+ public $title;
+ public $content;
+ public $status;
+ public $author;
+
+ protected static $RELATIONS=array
+ (
+ 'author' => array(self::BELONGS_TO, 'UserRecord'),
+ );
public static function finder($className=__CLASS__)
{