Keyed by PrimaryKey?

Dear all,

Just want to know is there any [color="#FF0000"]built-in[/color] function to get array of AR, keyed by primary key, instead of 0,1,2…

The array of AR is returned by findAll, and similar etc.

BR.


$models = Post::model()->findAll(array('index' => 'id'));

http://www.yiiframework.com/doc/api/1.1/CDbCriteria#index-detail

ha! thanks!!!!