Problem:
I used gii to generate database table models. So If I have any change in users table structure, I used gii and all my relations and other methods are removed from class. So I need to make backup of class and regenerate class and bring back other methods and relations.
Possible Solution:
I changed my class into two classes like this for a table 'users':
class Users extends UsersMapper { public function tableName() { return 'users'; } public function rules() { ..... } public function relations() { ..... } } class UsersMapper extends CActiveRecord { public function getAllUsers() { ...... } public function getBlockedUsers() { ...... } } Question:
Above method is working for me and I am using only Users class everywhere in my code. Is it valid method or there is any problem with this logic. Is there any other method.
Thanks