Skip to content

Commit 9bef9d5

Browse files
committed
minor #21480 [Validator] UniqueEntity - add warning about not supported types and association mappings. (wkania)
This PR was merged into the 6.4 branch. Discussion ---------- [Validator] UniqueEntity - add warning about not supported types and association mappings. This constraint does not support Doctrine types such as ``simple_array``, ``json``, or ``jsonb``, nor does it handle association mappings like One-To-Many and Many-To-Many relationships. It may also not work correctly with custom Doctrine types. To perform uniqueness checks on such fields, you must define a custom repositoryMethod that implements the desired logic. The previous [PR](#21262) closed itself due to an incorrect empty rebase, sorry. Commits ------- 31ec2a0 [Validator] UniqueEntity - add warning about not supported types and association mappings.
2 parents 28af525 + 31ec2a0 commit 9bef9d5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ between all of the rows in your user table:
139139
that haven't been persisted as entities yet. You'll need to create your own
140140
validator to handle that case.
141141

142+
.. warning::
143+
144+
This constraint does not support Doctrine types such as
145+
``simple_array``, ``json``, or ``jsonb``, nor does it handle association mappings
146+
like ``OneToMany`` and ``ManyToMany`` relationships. It may also not work correctly
147+
with custom Doctrine types. To perform uniqueness checks on such fields, you must
148+
define a custom ``repositoryMethod`` that implements the desired logic.
149+
142150
Options
143151
-------
144152

0 commit comments

Comments
 (0)