I’m mountaineering up the Yii learning curve here… The ‘Y’ in Yii stands for Yodel right!?
I have two tables, and i want to show the description from one which relates to the value of another.
Model: LeadTypes
Table: lead_types
-
id (int)[pk]
-
group (int)
-
description (varchar)
id | group | description
--------------------------
1 | 0 | something0
2 | 1 | something2
3 | 2 | something3
Model: Leads
Table: leads
-
id (int)
-
id_lead (int)[pk]
-
lead_type (int) [0,1,2]
-
…
‘lead_type_name_rel’=>array(self::BELONGS_TO, ‘LeadTypes’, ‘group’),
In the Leads grid view, I want to show LeadTypes.description where Leads.lead_type == LeadTypes.group
I’ve used BELONGS_TO etc for other things but they all have PK’s on ID, I thinkk this is causing me a problem… and im getting myself really confused. it IS showing the description, but linking to the Lead.id rather than Lead.lead_type