Skip to content

Commit ff5619c

Browse files
committed
[reference][constraints] Clarifying language - see #873
1 parent 1471dea commit ff5619c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ fields
8484
**type**: ``array``|``string`` [:ref:`default option<validation-default-option>`]
8585

8686
This required option is the field (or list of fields) on which this entity
87-
should be unique. For example, you could specify that both the email and
88-
name fields in the ``User`` example above should be unique.
87+
should be unique. For example, if you specified both the ``email`` and ``name``
88+
field in a single ``UniqueEntity`` constraint, then it would enforce that
89+
the combination value where unique (e.g. two users could have the same email,
90+
as long as they don't have the same name also).
91+
92+
If you need to require two fields to be individually unique (e.g. a unique
93+
``email`` *and* a unique ``username``), you use two ``UniqueEntity`` entries,
94+
each with a single field.
8995

9096
message
9197
~~~~~~~

0 commit comments

Comments
 (0)