diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index 93a24096d07..66cea8489e5 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -11,6 +11,7 @@ using an email address that already exists in the system. | Options | - `fields`_ | | | - `message`_ | | | - `em`_ | +| | - `repositoryMethod`_ | +----------------+-------------------------------------------------------------------------------------+ | Class | :class:`Symfony\\Bridge\\Doctrine\\Validator\\Constraints\\UniqueEntity` | +----------------+-------------------------------------------------------------------------------------+ @@ -111,3 +112,17 @@ The name of the entity manager to use for making the query to determine the uniqueness. If it's left blank, the correct entity manager will determined for this class. For that reason, this option should probably not need to be used. + + +repositoryMethod +~~~~~~~~~~~~~~~~ + +**type**: ``string`` **default**: ``findBy`` + +.. versionadded:: 2.1 + The ``repositoryMethod`` option was added in Symfony 2.1. Before, it was always using findBy. + + + +The name of the repository method to use for making the query to determine the +uniqueness. If it's left blank, the findBy method will be used. This method should return a countable result.