summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Database
diff options
context:
space:
mode:
authorwei <>2007-05-04 08:37:12 +0000
committerwei <>2007-05-04 08:37:12 +0000
commit8708f7e88e423b44ea4b3b8fff14f055d2b5c4ac (patch)
treef468f8990c7675089f804914453ba994d0c1be30 /demos/quickstart/protected/pages/Database
parentc1bddf3826ec570ea4c58d7a56c410ae54d26508 (diff)
Add saving/updating ActiveRecord relationships.
Diffstat (limited to 'demos/quickstart/protected/pages/Database')
-rw-r--r--demos/quickstart/protected/pages/Database/ActiveRecord.page14
1 files changed, 7 insertions, 7 deletions
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__)