konapaz
(Konapaz)
January 2, 2013, 2:46pm
1
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
jacmoe
(Jacob Moen)
January 2, 2013, 3:45pm
2
I think you could either inherit from CModel, or create a custom schema for CActiveRecord.
Perhaps the first option is better?
alirz23
(Alirz23)
January 2, 2013, 4:30pm
3
You can create a Model class that inherits CModel
example:
class Person extends CModel {
public $data=array();
}
mbi
(mbi)
January 2, 2013, 5:00pm
4
konapaz
(Konapaz)
January 2, 2013, 6:03pm
5
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?
konapaz
(Konapaz)
January 2, 2013, 6:06pm
6
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)
jacmoe
(Jacob Moen)
January 2, 2013, 6:25pm
7
konapaz
(Konapaz)
January 3, 2013, 9:31pm
8
CModel was my first choice for that, I think now is the arraymodel
thanks all of you and special jacmoe