Skip to content

Commit cf4a646

Browse files
author
Dimitri Gritsajuk
committed
Added ignoreFalse option to UniqueEntity constraint
1 parent a7c30bb commit cf4a646

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ using an email address that already exists in the system.
1515
| | - `entityClass`_ |
1616
| | - `errorPath`_ |
1717
| | - `ignoreNull`_ |
18+
| | - `ignoreFalse`_ |
1819
| | - `payload`_ |
1920
+----------------+-------------------------------------------------------------------------------------+
2021
| Class | :class:`Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\UniqueEntity` |
@@ -286,6 +287,16 @@ entities to have a ``null`` value for a field without failing validation.
286287
If set to ``false``, only one ``null`` value is allowed - if a second entity
287288
also has a ``null`` value, validation would fail.
288289

290+
ignoreFalse
291+
~~~~~~~~~~
292+
293+
**type**: ``boolean`` **default**: ``false``
294+
295+
If this option is set to ``true``, then the constraint will allow multiple
296+
entities to have a ``false`` value for a boolean field without failing validation.
297+
If set to ``false``, only one ``false`` value is allowed - if a second entity
298+
also has a ``false`` value, validation would fail.
299+
289300
.. include:: /reference/constraints/_payload-option.rst.inc
290301

291302
.. _`race conditions`: https://en.wikipedia.org/wiki/Race_condition

0 commit comments

Comments
 (0)