Skip to content

Commit 5832e03

Browse files
authored
[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. To perform uniqueness checks on such fields, you must define a custom repositoryMethod that implements the desired logic.
1 parent 45ad3bf commit 5832e03

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
@@ -402,4 +402,12 @@ blank, ``findBy()`` will be used. The method receives as its argument a
402402
fields configured in the ``fields`` option). The method should return a
403403
:phpfunction:`countable PHP variable <is_countable>`.
404404

405+
.. warning::
406+
407+
This constraint does not support Doctrine types such as ``simple_array``,
408+
``json``, or ``jsonb``, nor does it handle association mappings like
409+
``One-To-Many`` and ``Many-To-Many`` relationships. To perform uniqueness
410+
checks on such fields, you must define a custom ``repositoryMethod`` that
411+
implements the desired logic.
412+
405413
.. _`race conditions`: https://en.wikipedia.org/wiki/Race_condition

0 commit comments

Comments
 (0)