forms icon indicating copy to clipboard operation
forms copied to clipboard

FR: Add getChangedValues() method

Open milo opened this issue 5 years ago • 0 comments

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().

milo avatar Oct 18 '18 13:10 milo