Building A Crud While Sourcing Data From External Source

I am building a Yii extension for using an API that I made for another Yii website. I am trying to build an example CRUD system similar to what Gii generates. My question is where should the data be fetched(the curl api calls be made) into the system.

I had two systems in mind. I shall provide a simple model for the entity which will extend CModel and overwrite the default methods such as find(), findAll() and count() . I fear I might have to overwrite a lot many functions that way and also use CArrayDataProvider while rendering the GridView.

Another approach which looks semantic but I am not sure that it will work is providing a custom DataProvider. This way I shall define the fetchData, fetchKeys and calculateTotalItemCount(). This appears to be a more semantic approach as I just need to define the way data and metrics have to be fetched. Is there a way I define only the DataProvider and use it to define an activerecord(CModel) like object. This also makes the extension more usable as users will be able to further extend this object and provide more features like adding extra fields to the object or use relations to the new data.

bump