I have a very large profile object (userName, Icon, favoriteFood etc...)
On an update profile page, the user can change none, some, or all of these at the same time...
Does anyone have a best practice idea of what this should look like?
I can think of several ways to do this:
1. update the users main profile object with one change at a time
(many sql updates)
- have 2 profile objects:
$profileCurrent = dataFromDB
$profileUpdates = htmlFormChanges
Then some methods:
validateAllFields($profileUpdates)
commitAllChanges($profileUpdates)
Neither way seems completely ideal, though the 2nd does seem a bit better... any ideas?
--
In case the above isn't clear.... I'm basically asking what is the best way to update many properties of the same object at the same time.
Thanks,
-Eric