Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Closed

Conversation

henry2778
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
Deprecations? no
Tickets #37451
License MIT
Doc PR todo

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! :)

@henry2778 henry2778 changed the title Feature/unique validator normalizer [Validator] Add valueNormalizer option Jul 6, 2020
@henry2778 henry2778 changed the title [Validator] Add valueNormalizer option [Validator] Add valueNormalizer option to Unique Constraint Jul 6, 2020
@xabbuh xabbuh added this to the next milestone Jul 7, 2020
@henry2778 henry2778 force-pushed the feature/unique-validator-normalizer branch from dd83391 to 6568ee9 Compare August 8, 2020 16:33
@fabpot fabpot closed this Oct 7, 2020
@fabpot
Copy link
Member

fabpot commented Oct 7, 2020

We've just moved away from master as the main branch to use 5.x instead. Unfortunately, I cannot reopen the PR and change the target branch to 5.x. Can you open a new PR referencing this one to not loose the discussion? Thank you for your understanding and for your help.

@henry2778
Copy link
Contributor Author

We've just moved away from master as the main branch to use 5.x instead. Unfortunately, I cannot reopen the PR and change the target branch to 5.x. Can you open a new PR referencing this one to not loose the discussion? Thank you for your understanding and for your help.

Sure, no problem

@nicolas-grekas nicolas-grekas modified the milestones: 5.x, 5.2 Oct 14, 2020
derrabus added a commit that referenced this pull request Mar 18, 2021
… (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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants