Model relations question

Can I set relation that can’t join with id

class User extends CActiveRecord


        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(

                    'client' => array(self::BELONGS_TO,'Client','profile')



	public function search()


		$criteria=new CDbCriteria(array(




		return new CActiveDataProvider($this, array(


                        'pagination' => array('pageSize' => 10),



output: = User.profile

but I want: = User.profile

Hi andjelko

You can use the "on" option to specify the join:

Best regards,


thanks a lot