Skip to content

Commit 6982e9e

Browse files
committed
Merge pull request #2552 from jockri/fix_missing_ignorenull
Added missing UniqueEntity ignoreNull documentation
2 parents 2e189a6 + 596bea5 commit 6982e9e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ using an email address that already exists in the system.
1212
| | - `message`_ |
1313
| | - `em`_ |
1414
| | - `repositoryMethod`_ |
15+
| | - `ignoreNull`_ |
1516
+----------------+-------------------------------------------------------------------------------------+
1617
| Class | :class:`Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\UniqueEntity` |
1718
+----------------+-------------------------------------------------------------------------------------+
@@ -149,3 +150,15 @@ repositoryMethod
149150
The name of the repository method to use for making the query to determine the
150151
uniqueness. If it's left blank, the ``findBy`` method will be used. This
151152
method should return a countable result.
153+
154+
.. versionadded:: 2.1
155+
The ``ignoreNull`` option was added in Symfony 2.1.
156+
157+
ignoreNull
158+
~~~~~~~~~~
159+
160+
**type**: ``Boolean`` **default**: ``true``
161+
162+
If this option is set to ``true``, it allows having multiple ``null`` values for
163+
the field(s) without failing the unique constraint. If set to ``false``, only one
164+
``null`` value is allowed.

0 commit comments

Comments
 (0)