From 34dffbdadcf4bb9247b303170ad5e31e800c9203 Mon Sep 17 00:00:00 2001 From: Klein Florian Date: Wed, 16 Jan 2013 10:53:35 +0100 Subject: [PATCH 1/3] Docs for repositoryMethod option of UniqueEntity --- reference/constraints/UniqueEntity.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index 93a24096d07..a1e99238638 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,11 @@ 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`` + +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. From fa327297599b73505f5cd22a0aa91266a8ed9e63 Mon Sep 17 00:00:00 2001 From: Klein Florian Date: Wed, 16 Jan 2013 11:15:35 +0100 Subject: [PATCH 2/3] add versionadded tag --- reference/constraints/UniqueEntity.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index a1e99238638..4a6b4ff7190 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -113,10 +113,12 @@ 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`` +.. versionadded:: 2.1 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. From 7679617e416c48a3675c896e83eddb438db7d731 Mon Sep 17 00:00:00 2001 From: Klein Florian Date: Fri, 25 Jan 2013 15:34:01 +0100 Subject: [PATCH 3/3] Update reference/constraints/UniqueEntity.rst --- reference/constraints/UniqueEntity.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index 4a6b4ff7190..66cea8489e5 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -117,8 +117,12 @@ used. repositoryMethod ~~~~~~~~~~~~~~~~ -**type**: ``string`` +**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.