1
1
UniqueEntity
2
2
============
3
3
4
- Validates that a particular field (or fields) in a Doctrine entity are unique.
5
- This is commonly used, for example, to prevent a new user to register using
6
- an email address that already exists in the system.
4
+ Validates that a particular field (or fields) in a Doctrine entity is (are)
5
+ unique. This is commonly used, for example, to prevent a new user to register
6
+ using an email address that already exists in the system.
7
7
8
8
+----------------+-------------------------------------------------------------------------------------+
9
9
| Applies to | :ref: `class<validation-class-target> ` |
@@ -20,9 +20,10 @@ an email address that already exists in the system.
20
20
Basic Usage
21
21
-----------
22
22
23
- Suppose you have an ``AcmeUserBundle `` with a ``User `` entity that has an
24
- ``email `` field. You can use the ``Unique `` constraint to guarantee that the
25
- ``email `` field remains unique between all of the constrains in your user table:
23
+ Suppose you have an ``AcmeUserBundle `` bundle with a ``User `` entity that has an
24
+ ``email `` field. You can use the ``UniqueEntity `` constraint to guarantee that
25
+ the ``email `` field remains unique between all of the constraints in your user
26
+ table:
26
27
27
28
.. configuration-block ::
28
29
@@ -84,19 +85,19 @@ fields
84
85
85
86
This required option is the field (or list of fields) on which this entity
86
87
should be unique. For example, you could specify that both the email and
87
- name fields in the User example above should be unique.
88
+ name fields in the `` User `` example above should be unique.
88
89
89
90
message
90
91
~~~~~~~
91
92
92
93
**type **: ``string `` **default **: ``This value is already used. ``
93
94
94
- The message that's displayed with this constraint fails.
95
+ The message that's displayed when this constraint fails.
95
96
96
97
em
97
98
~~
98
99
99
100
**type **: ``string ``
100
101
101
102
The name of the entity manager to use for making the query to determine the
102
- uniqueness. If left blank, the default entity manager will be used.
103
+ uniqueness. If it's left blank, the default entity manager will be used.
0 commit comments