ActiveRecord-Relation to Module-Model

Hi everybody,

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'),




no idea?

	public function relations()



		return array(

                        'user' => array(self::BELONGS_TO, 'User', 'user_id'),




have a look here:

thx, i think this will help. I’ll try it later and report it.

it worked! thx again.

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?



nothing to do for getting model from the main structure


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.


Replying to my own question, came across and am adding


to the relations function