Or the $newEntityData might be another full entity, for example in its new state.
It doesn't really matter, the algo is always the same: it scans for new keys
in $newEntityData and changed values on existing keys and adds those two things
to the result. 'vp_id' key is ignored by default.
Note: keys may never be "removed" (or marked as removed) in the diff because that
will just not ever happen - the SQL UPDATE command is only capable of sending a change,
clearing a key value at most but never "removing" it entirely.
public static getDiff ( array $oldEntityData, array $newEntityData ) : array | ||
$oldEntityData | array | Usually a full entity data in its original state |
$newEntityData | array | Full or partial data of the new entity |
return | array | Key=>value pairs of things that are new or changed in $newEntity (they can never be "removed", that will never happen when capturing SQL UPDATE actions) |