In my form, if an input field is not changed, I don't want to update that particular field in database. How can I achieve this in beforesave() ? I tried $entity->unset($fieldName); but that doesn't work.
UPDATE:
In my form, for one filed, I am saving encrypted data in database, and in beforeFind(), if this field is not null in database, this input is set to "*** ***". My encryption code for this field is in beforeSave(). I want to update this field only if it is not "*** ***".
my code is working fine when
$entity->unset($fieldName);changed tounset($entity->$fieldName);