for example:
$user = new User();
// create table tbl_user(id not null increase,name varchar);
$user->saveAttribute(array(‘name’=>‘OnlyPHP’));
// it is a error about model must be isnewrecord;
but i try it under;
// as same user table;
User::model()->saveAttributes(array(‘name’=>‘OnlyPHP’));
//result is : new record is inserted sucess;
why it is ?
when I using “User::Model()” ,then model’s isNewRcord Attribute is false? so I can exec saveAttriubte function by pass array。