Model Without Database

Hi to everyone

which is the best Model type to make a model without database but get data from php array ?

I found the bellow link but the CFormModel is designed to collect data from user

I want a same model CActiveRecord with its functionality but without Database (only raw php array)

Is it possible?


I think you could either inherit from CModel, or create a custom schema for CActiveRecord.

Perhaps the first option is better? :)

You can create a Model class that inherits CModel


class Person extends CModel {

    public $data=array();


Thanks all of you!

can I have with CModel the most advantages of CActiveRecord functionality like relations (with another CModel), queries (findAll, criteria, with etc) or I have to make my own?

Hi mbi

Your solution seems more as a managing of array data rather than a Model. My question is the same of above.

Can I have the advantages of AR model? (about CActiveRecord)

Try this:

CModel was my first choice for that, I think now is the arraymodel

thanks all of you and special jacmoe :)