$model->unsetAttributes()

In what situation is $model->unsetAttributes() used in?

I notice it is used in the controller action when displaying a CGridView. Do I still need this if I’m not using CGridView filters?

When you create a new model, if the table coresponding to that model has some columns with default values, the coresponding attributes in the model will have default values, too…

That’s why unsetAttributes() is used before calling CGridView to reset default values for the filter…