From 8c7fa78c142deb5ece9dc4e7b30c1833713ab9c9 Mon Sep 17 00:00:00 2001 From: Dimitri Gritsajuk Date: Tue, 25 Sep 2018 23:53:57 +0200 Subject: [PATCH] Added ignoreFalse option to UniqueEntity constraint --- reference/constraints/UniqueEntity.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index 331901b09f0..3f7dc717a27 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -15,6 +15,7 @@ using an email address that already exists in the system. | | - `entityClass`_ | | | - `errorPath`_ | | | - `ignoreNull`_ | +| | - `ignoreFalse`_ | | | - `payload`_ | +----------------+-------------------------------------------------------------------------------------+ | Class | :class:`Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\UniqueEntity` | @@ -286,6 +287,16 @@ entities to have a ``null`` value for a field without failing validation. If set to ``false``, only one ``null`` value is allowed - if a second entity also has a ``null`` value, validation would fail. +ignoreFalse +~~~~~~~~~~~ + +**type**: ``boolean`` **default**: ``false`` + +If this option is set to ``true``, then the constraint will allow multiple +entities to have a ``false`` value for a boolean field without failing validation. +If set to ``false``, only one ``false`` value is allowed - if a second entity +also has a ``false`` value, validation would fail. + .. include:: /reference/constraints/_payload-option.rst.inc .. _`race conditions`: https://en.wikipedia.org/wiki/Race_condition