Dear all,
I use $model->attributes = $_POST[‘my_model_name’] to assign my post values to the model instance. One field of my post is now not assigned to my model and I don’t know why.
This is my post-dump:
array(5) {
["bdk_number"]=>
string(4) "4712"
["region_id"]=>
string(1) "1"
["name"]=>
string(28) "XYZ"
["has_adress"]=>
string(1) "0"
["position_id"]=>
string(1) "1"
}
This is my code to assign in my controller class:
var_dump($_POST['Club']);
$model->attributes=$_POST['Club'];
var_dump($model->attributes);
and this is the dump after:
array(9) {
["id"]=>
string(1) "1"
["bdk_number"]=>
string(4) "4712"
["region_id"]=>
string(1) "1"
["name"]=>
string(28) "XYZ"
["has_adress"]=>
string(1) "0"
["adress_id"]=>
string(1) "0"
["position_id"]=>
string(1) "0"
["created_at"]=>
string(19) "2013-05-02 13:19:20"
["updated_at"]=>
string(19) "2013-05-08 13:48:07"
}
Updating the name-attribute is working and the position_id not.
What can be the reason?