From a9c2fc27a3020b3ed62436576137b9c10250786a Mon Sep 17 00:00:00 2001 From: Maxime Steinhausser Date: Thu, 13 Oct 2016 18:59:44 +0200 Subject: [PATCH] [DoctrineBridge] Document the new `entityClass` option --- reference/constraints/UniqueEntity.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/reference/constraints/UniqueEntity.rst b/reference/constraints/UniqueEntity.rst index 7d03f107aa9..4cf06d70c1a 100644 --- a/reference/constraints/UniqueEntity.rst +++ b/reference/constraints/UniqueEntity.rst @@ -12,6 +12,7 @@ using an email address that already exists in the system. | | - `message`_ | | | - `em`_ | | | - `repositoryMethod`_ | +| | - `entityClass`_ | | | - `errorPath`_ | | | - `ignoreNull`_ | | | - `payload`_ | @@ -164,6 +165,20 @@ 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. +entityClass +~~~~~~~~~~~ + +**type**: ``string`` **default**: ``null`` + +.. versionadded:: 3.2 + The ``entityClass`` option was introduced in Symfony 3.2. + +By default, the query performed to ensure the uniqueness uses the repository of +the current class instance. However, in some cases, such as when using Doctrine +inheritance mapping, you need to execute the query in a different repository. +Use this option to define the fully-qualified class name (FQCN) of the Doctrine +entity associated with the repository you want to use. + errorPath ~~~~~~~~~