I have a controller function creating attributes for a model from posted data and sending them to a service to save the data.
Everything seems to be working correctly if I do a print_r in the service function before using setAttributes it is returning the posted data correctly with the changed attribute value. However when I use
$record->setAttributes($model->getAttributes());
The array that is printed after is using the database values so it is not setting the new attribute as the function suggests.
I have read other posts which suggest there may be a bug with the setAttributes function and a work around setting each post item individually (not ideal) plus I have tried this and it produces the same result.
Am I missing something obvious as to why the setAttributes is not updating the $record variable with the new $model attributes?
Cheers