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

http://www.yiiframework.com/forum/index.php/topic/8442-yii-application-without-database/

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

Is it possible?

Thanks

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

example:


class Person extends CModel {

    public $data=array();

}

http://www.yiiframework.com/doc/api/1.1/CConfiguration/

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:

http://www.yiiframework.com/extension/arraymodel/

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

thanks all of you and special jacmoe :)