-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Validator] Add valueNormalizer option to Unique Constraint #37507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Validator] Add valueNormalizer option to Unique Constraint #37507
Conversation
dd83391
to
6568ee9
Compare
We've just moved away from |
Sure, no problem |
… (henry2778) This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- [Validator] Add normalizer option to Unique constraint | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | #37451 | License | MIT | Doc PR | todo Hello! Reopening my PR #37507 with target branch `5.x` This PR is about #37451. The idea is to make that constraint more flexible and able to process business rules, especially when working with objects. We can think about it as the similar feature in UniqueEntity constraint, when we declare on which attributes we are applying the constraint. But in our case it is more general - we pass a callable with whatever logic we want to apply to collection elements before we apply 'uniqueness check' :) Looks like no BC breaks. Thanks! :) Commits ------- 44e1e8b [Validator] Add normalizer option to Unique constraint
Hello. This PR is about #37451. The idea is to make that constraint more flexible and able to process business rules, especially when working with objects. Please have a look to have an idea. We can think about it as the similar feature in UniqueEntity constraint, when we declare on which attributes we are applying the constraint. But in our case it is more general - we pass a callable with whatever logic we want to apply to collection elements before we apply 'uniqueness check' :)
Added some tests, but hopefully will have some extra time this week and will improve them :)
Looks like no BC breaks. Thanks! :)