10000 Add doc for UniqueEntity new feature · symfony/symfony-docs@ea51a51 · GitHub
[go: up one dir, main page]

Skip to content

Commit ea51a51

Browse files
Add doc for UniqueEntity new feature
1 parent 1b989b8 commit ea51a51

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,13 +251,18 @@ each with a single field.
251251
``ignoreNull``
252252
~~~~~~~~~~~~~~
253253

254-
**type**: ``boolean`` **default**: ``true``
254+
**type**: ``boolean`` | ``array`` | ``string`` **default**: ``true``
255255

256256
If this option is set to ``true``, then the constraint will allow multiple
257257
entities to have a ``null`` value for a field without failing validation.
258258
If set to ``false``, only one ``null`` value is allowed - if a second entity
259259
also has a ``null`` value, validation would fail.
260260

261+
As of Symfony 6.3, the ``UniqueEntity`` constraint allows you to ignore null
262+
values on specific fields when checking for uniqueness. This feature can be
263+
helpful when you want to validate the uniqueness of a combination of fields,
264+
but want to exclude combinations where one or more of the fields are null.
265+
261266
``message``
262267
~~~~~~~~~~~
263268

0 commit comments

Comments
 (0)
0