I need a custom class that is similar to the CActiveRecord but without the related database table.
The reason is that I need to set the attributes of the class as follows.
$model->attributes=$_POST['LoginForm'];
I have compared two classes of CActiveRecord and its parent CModel.
CModel: does not have setters and getters for attributes.
CActiveRecord: must have a database table.
Obviously, I have tried to extend CModel, borrowing some functionalities from CActiveRecord, I failed to do for I was not able to get meta data of the members (properties).
The reason I cannot massively assign the properties was a rule which I have not defined in the model.
I made my model extending CFormModel (because this is described as ActiveRecord without database) and made a rule that the properties are ‘safe’, I was succeded to assign those properties massively.
BTW, extending from CModel is not working because we have to define attributeNames() (with this method, it is working), extending from CForm is not working because it may requires the class config file for the constructor. Consequently CFormModel is the best choice, I suppose.