Custom Relation Model

Hi to everyone

I have two models and I want to have custom relation between them

the foreign key one of them is a part of the other so the below code

public function relations()


'relTable' => array(self::BELONGS_TO, 'anotherAr', 'foreign_id'),


has to modified appropriate by a condition like

WHERE LIKE '%foreign_id%'

Is there way to do that in relations Model method or I have to do directly in controller by sql query ?


I found exatly what I want in the below post

Thanks Tommy (tri) :)