[Validator] Improve documentation for UniqueEntity constraint#21197
[Validator] Improve documentation for UniqueEntity constraint#21197ker0x wants to merge 3 commits intosymfony:7.3from
UniqueEntity constraint#21197Conversation
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.
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.
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.
Now, I see that in the end I didn't do it like fields argument.
|
@xabbuh @javiereguiluz could it be possible to review this PR please? |
|
I've just found this hidden option and wanted to share, but then realised that this PR already existed to add this. Can I help get this over the line? It looks like the checks are failing because a code block mentions the Doctrine classes that aren't found in this project, perhaps? |
Replace #14458 and #20166
I'm targeting
7.3because i don't know if changes made in7.1are transferred to 7.3. Otherwise, let me know and I'll change it.