i'm new to Yii.
I have 3 tables.
Entry, Study and Program
Relation is: A Study has many Entries and a Study belongs to a single Program.
I wish to define a model for Entry to display a databrowser (CGridView) containing all entries, and displaying the Program that entry belongs to.
Entry has study_id -> referring to Study,
Study has program_id -> referring to a Program,
Program has attribute name.
I wish to display the program name where the Entry belongs to. I just know how to define a single relation Entry, but i'm totally clueless with my present problem. What should be my relation for this? and what attribute/s?
public function relations(){ return array( ... 'study' => array(self::BELONGS_TO, 'Study', 'study_id'), ); } And also, if i have this relation, how will i define my sort then for the dataprovider?
'sort'=>array( 'attributes'=>array( '*' ) ) Many thanks!