Hey there!
How do I save only modified fields ? I mean, i have a form (the same for inserting, im using the default generated CRUD), so if the users leave a field blank, it should not update that field. In my case I also have two comboboxes that has a value=0 option, and it should not save those too. If there's no modified field, so it leaves the record without any changes. How do I do that?
Thanks in advance
Page 1 of 1
How to save only modified fields
#3
Posted 17 January 2010 - 06:28 AM
http://www.yiiframew...ord#save-detail
Look at the second parameter. But you have to generate it manually.
Look at the second parameter. But you have to generate it manually.
#5
Posted 17 January 2010 - 11:47 AM
Try to search the forums, there has been a similar discussion some months ago. And not sure, there might even be an extension doing that. The main principle is: After loading a record (afterFind()) you have to copy the attributes (e.g. to private array in the record) in order to find out, which of them have changed when you want to save the record again.
Share this topic:
Page 1 of 1

Help














