Cast result to different object in find

I have an object extending CActiveRecord called Post and I want to be able to do Post::model()->findAll() but have inside the results array objects of PostA, PostB depending of a field in the table called type.

PostA and PostB would inherit from Post and Post would be abstract.

Thanks.