Special Join*

I have 2 models:




class SolutionModel extends CActiveRecord;

class FileModel extends CActiveRecord



in the table ITAL_FILE (representing FileModel) there are stored images and i have to join by this attributes and criteria:




ITAL_FILE.TARGET = "Solution"

ITAL_FILE.TARGET_ID = <my Id from SolutionModel>

ITAL_FILE.TARGET_N = 1



Obviously in my SolutionController i access to ITAL_SOLUTION table calling:


SolutionModel::model()->findAll();

I can not figure out how to set the relations in both my models SolutionModel and FileModel!

My question: it is possible to link considering the attributes defined upper?! If yes, how?!

My goal is to access the ITAL_FILE.PATH/FileModel->PATH (myPic.jpg) from the view like this?


$reference->PATH

*where reference is one item returned by the FindAll

Thanks