-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Validator] Improve documentation for UniqueEntity
constraint
#21197
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
base: 7.3
Are you sure you want to change the base?
Conversation
604f8fe
to
b1a3e1a
Compare
UniqueEntity
constraint
7f65194
to
a7cfb4f
Compare
Nice. Looking at my pull request, I think it would also be helpful to mention which version of Symfony introduced this feature.
|
``identifierFieldNames`` | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
**type**: ``array`` **default**: ``[]`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type should be **type**: ``array`` | ``string`` [:ref:`default option <validation-default-option>`]
It accept string when not combined identifier. Like:
identifierFieldNames: 'id'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so because the property is typed with ?array
in the UniqueEntity class: https://github.com/symfony/doctrine-bridge/blob/7.3/Validator/Constraints/UniqueEntity.php#L60
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, I see that in the end I didn't do it like fields
argument.
Replace #14458 and #20166
I'm targeting
7.3
because i don't know if changes made in7.1
are transferred to 7.3. Otherwise, let me know and I'll change it.