8000 [reference] [constraints] fixed various typos in UniqueEntity constraint... by hhamon · Pull Request #1213 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[reference] [constraints] fixed various typos in UniqueEntity constraint... #1213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions reference/constraints/UniqueEntity.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
UniqueEntity
============

Validates that a particular field (or fields) in a Doctrine entity are unique.
This is commonly used, for example, to prevent a new user to register using
an email address that already exists in the system.
Validates that a particular field (or fields) in a Doctrine entity is (are)
unique. This is commonly used, for example, to prevent a new user to register
using an email address that already exists in the system.

+----------------+-------------------------------------------------------------------------------------+
| Applies to | :ref:`class<validation-class-target>` |
Expand All @@ -20,9 +20,10 @@ an email address that already exists in the system.
Basic Usage
-----------

Suppose you have an ``AcmeUserBundle`` with a ``User`` entity that has an
``email`` field. You can use the ``Unique`` constraint to guarantee that the
``email`` field remains unique between all of the constrains in your user table:
Suppose you have an ``AcmeUserBundle`` bundle with a ``User`` entity that has an
``email`` field. You can use the ``UniqueEntity`` constraint to guarantee that
the ``email`` field remains unique between all of the constraints in your user
table:

.. configuration-block::

Expand Down Expand Up @@ -84,19 +85,19 @@ fields

This required option is the field (or list of fields) on which this entity
should be unique. For example, you could specify that both the email and
name fields in the User example above should be unique.
name fields in the ``User`` example above should be unique.

message
~~~~~~~

**type**: ``string`` **default**: ``This value is already used.``

The message that's displayed with this constraint fails.
The message that's displayed when this constraint fails.

em
~~

**type**: ``string``

The name of the entity manager to use for making the query to determine the
uniqueness. If left blank, the default entity manager will be used.
uniqueness. If it's left blank, the default entity manager will be used.
0