Hi!
I have a problem and I want to know if Yii Framework always manage it.
I have define a relation between 2 models (extending CActiveRecord) Equipement and LibelleEquipement, here is the relations function define in Equipement model :
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'libele' => array(self::BELONGS_TO, 'TblLibelleEquipement', 'id'),
'num0' => array(self::BELONGS_TO, 'TblCategorie', 'num'),
'tblStation' => array(self::BELONGS_TO, 'TblStation', 'tbl_station_id'),
'tblEtatEquipements' => array(self::HAS_MANY, 'TblEtatEquipement', 'tbl_equipement_id'),
);
}
And here is the relations function in LibelleEquipement :
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
'tblEquipements' => array(self::HAS_MANY, 'TblEquipement', 'libele')
);
}
My problem is the fact that when I display an equipement trought CGridView/CDetailView an integer is displayed as libele value. I want to know if there is a way to display the corresponding libele string in LibelleEquipement table.
So the user will see a string but, integers is use for relation.
Thanks