FR: Add getChangedValues() method
milo opened this issue · comments
Miloslav Hůla commented
Can be useful to receive only updated values from form/container. For example:
$diff = $form->getUpdatedValues();
if (count($diff)) {
$db->update(...);
} else {
$this->flash('Nothing changed.');
}
# or
$this->log("User $username:", $form->getUpdatedValues());
API changes from top of my head:
FormContainer::getChangedValues()
BaseControl::setAlwaysChanged(bool ...)
Hard to decide in which point create an original values snapshot. Probably exactly before Form::getHttpData().