Hello,
Do we need each class for each tables we have in the database, for example at the tutorial: http://www.yiiframew…e/database.arr.
class Post extends CActiveRecord { public function relations() { return array( 'author'=>array(self::BELONGS_TO, 'User', 'authorID'), 'categories'=>array(self::MANY_MANY, 'Category', 'PostCategory(postID, categoryID)'), ); } }
Please refer to exactly at the line:
'categories'=>array(self::MANY_MANY, 'Category', 'PostCategory(postID, categoryID)'),
Now, I am a bit ambigued with the PostCategory(postID, categoryID) in this array ? Is it the PostCategory class which extends the CActiveRecord or is it the table name ?
If it is a class, could anybody kindly post what should be defined for the RelationType ?
Thank you,
Chris