i have some models in my app like ‘file’ and in the database file has a column creator_id.
On other hand i am using yii-user-module. Now i’d like to make a relationship between file and user.
how do i do this?
i tried following in my file-model, but didn’t help:
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(
'user' => array(self::BELONGS_TO, 'modules.user.User', 'user_id'),
);
}
MBI — What if you’re going the other way? I want to get a module model to make a relationship with a model from the main structure. How do I import the main structure? Or do I need to?
I am new to Yii Framework and need help with the same thing. Although the link mentioned in the previous messages with the answer is no longer available or does not open for me. Could someone please guide me to some other place with the same answer.