From 8708f7e88e423b44ea4b3b8fff14f055d2b5c4ac Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 4 May 2007 08:37:12 +0000 Subject: Add saving/updating ActiveRecord relationships. --- .../quickstart/protected/pages/Database/ActiveRecord.page | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'demos/quickstart') diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page index adcb7783..1e3c69c5 100644 --- a/demos/quickstart/protected/pages/Database/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page @@ -547,9 +547,9 @@ class PlayerRecord extends TActiveRecord protected static $RELATIONS=array ( - 'team' => array(SELF::BELONGS_TO, 'TeamRecord'), - 'skills' => array(SELF::HAS_MANY, 'SkillRecord', 'Player_Skills'), - 'profile' => array(SELF::HAS_ONE, 'ProfileRecord'), + 'team' => array(self::BELONGS_TO, 'TeamRecord'), + 'skills' => array(self::HAS_MANY, 'SkillRecord', 'Player_Skills'), + 'profile' => array(self::HAS_ONE, 'ProfileRecord'), ); public static function finder($className=__CLASS__) @@ -572,7 +572,7 @@ class ProfileRecord extends TActiveRecord protected static $RELATIONS=array ( - 'player' => array(SELF::BELONGS_TO, 'PlayerRecord'), + 'player' => array(self::BELONGS_TO, 'PlayerRecord'), ); public static function finder($className=__CLASS__) @@ -589,14 +589,14 @@ class ProfileRecord extends TActiveRecord class SkillRecord extends TActiveRecord { const TABLE='Skills'; - public $player_id; - public $salary; + public $skill_id; + public $name; public $players=array(); protected static $RELATIONS=array ( - 'players' => array(SELF::HAS_MANY, 'PlayerRecord', 'Player_Skills'), + 'players' => array(self::HAS_MANY, 'PlayerRecord', 'Player_Skills'), ); public static function finder($className=__CLASS__) -- cgit v1.2.3