Closed leth closed 14 years ago
Not sure how generally useful this would be. Can you give some use cases?
It is trivial to code but it is better to leave out stuff that won't really be used.
Off the top of my head:
The reason I wanted to revert was that the particular form I was showing changed depending on the value of one of the fields, so I wanted to revert back to the old data so the same form would be shown again (overriding the field values directly from $_POST
).
Hmm. I can see how it would be great in that particular case but that seems a bit of an edge case to me. I guess for now we probably won't put it in as it just won't be used by many people.
Sure.
Mostly I just thought it a bit weird at the time that you'd have a clear()
method, but no revert()
method.
I think (but am not sure) clear()
is used when iterating through collections since we actually reuse an instance and clone as it is far quicker.
Adding revert() method. Closed by 49f2937adaec5d1f0bba1ea0ab6ab22d7f84fc48. Thanks leth!
How about a method to revert unsaved changes to a model (or field)? I couldn't see one at first glance.
I'm willing to submit a patch for this, if you'd like it added :)