It can
- properly deal with multi-fields uniqueness checks (and composite PKs)
- use symfony's property path or directly private properties
- does not cause hydration when checking
- allows to optionally map to existing entity (by having it as property) or by mapping id fields (or none at all so any matching record will trigger a failure)
- allows to re-map fields between DTO and entity (eg.
fields={"display_name": "username"}
). Combined with sf property accessor this allows for "virtual properties". This also works for id fields - load the violating record to show in debug panel. Example http://prntscr.com/i3ifbn
- not get confused if multiple violating records are found