Find Using 'with' And Select Columns

I have the following:

User model:


'supplier' => array(self::HAS_ONE, 'Supplier', 'user_id'),

In my view I want to get the current User plus supplier.id. I do the following:


<?php $user = User::model()->findByPk(Yii::app()->user->id, array('with'=>'supplier', 'select'=>'t.*, supplier.id')); ?>

But this still fetches all columns from supplier model.

Please take a look at this API document on how you can use ‘with’ and select required attributes.

http://www.yiiframework.com/doc/api/1.1/CActiveRecord#with-detail