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 anotherAr.id LIKE '%foreign_id%'

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

Thanks

I found exatly what I want in the below post

http://www.yiiframework.com/forum/index.php/topic/19844-solved-how-to-create-custom-relation-for-active-record/page__view__findpost__p__97177

Thanks Tommy (tri) :)