relation with a model from an extension?

I am not sure how to ask this, but here it goes:

I need a way to join the model of an extension to an existing model I have that isn’t a part of the extension I’m currently trying to join.

To illustrate what I’m after, check this out:

This would be the Patinent.php model myapp/protected/models/Patient.php

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(


	'media' => array(self::HAS_MANY, 'extensions.FBGallery.Gallery', 'pid')


	);


}

And the extension is at myapp/protected/extensions/FBGallery/Gallery.php (the Gallery Model)

Now I’m not sure if this is possible but I want to join the gallery model to my Patient model.

Does this make sense to you guys?

Thanks in advance

Take it easy.

Add extensions.FBGallery to your path in config/main or in the model file with:




Yii::import('extensions.FBGallery.*');




and then simply use




'media' => array(self::HAS_MANY, 'Gallery', 'pid')



Thank you very much! :) The only thing I had to add extra was “application.” part of the Yii::import… otherwise worked exactly as you described. Thanks again!