Skip to content

Commit 7133238

Browse files
committed
Merge pull request #2145 from docteurklein/patch-1
Docs for repositoryMethod option of UniqueEntity
2 parents 9c4200d + 7679617 commit 7133238

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ using an email address that already exists in the system.
1111
| Options | - `fields`_ |
1212
| | - `message`_ |
1313
| | - `em`_ |
14+
| | - `repositoryMethod`_ |
1415
+----------------+-------------------------------------------------------------------------------------+
1516
| Class | :class:`Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\UniqueEntity` |
1617
+----------------+-------------------------------------------------------------------------------------+
@@ -111,3 +112,17 @@ The name of the entity manager to use for making the query to determine the
111112
uniqueness. If it's left blank, the correct entity manager will determined for
112113
this class. For that reason, this option should probably not need to be
113114
used.
115+
116+
117+
repositoryMethod
118+
~~~~~~~~~~~~~~~~
119+
120+
**type**: ``string`` **default**: ``findBy``
121+
122+
.. versionadded:: 2.1
123+
The ``repositoryMethod`` option was added in Symfony 2.1. Before, it was always using findBy.
124+
125+
126+
127+
The name of the repository method to use for making the query to determine the
128+
uniqueness. If it's left blank, the findBy method will be used. This method should return a countable result.

0 commit comments

Comments
 (0)