ActiveRecord - Table has the same name of object CActiveRecord(attributes)

I guys

I have had problems about Yii crud. I have a table called biologicalelelements and one of its fields is attributes. At this point all right, but when I try save one record in database, look the screenshot tela1.jpg. When the Yii constructs the array of values from the form, saves field Attributes value "Array".

I don't look the code to fix it. I would like someone has already had this problem and has worked to solve it, whether not I am going to work it.

The screenshot below(tela2.jpg) shows the create’s page. This page is a crud default implementation.

In attach follow my _form.php, biologicalelements.php.

Ps.: I checked this bug in Yii 1.0.7.

Thank you for all!!!

Use $model->setAttributes($_POST[ModelClass]) to assign user input to the model. Using $model->attributes=$_POST[ModelClass] would assign the input to the 'attributes' column.

Thanks Qiang,

It works now, but it is a problem from crud default code created. Do you intend fix it. Can I try?

Once more, thank you very much.

Probably no need to fix the crud code. Yes this problem will occur if a table has attributes column. But in most of the time, writing $model->attributes=$input; looks cleaner and should work.