From bab634bb4acdfe3ecc3d2a5288d500e073a83569 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 3 Dec 2016 15:38:50 +0100 Subject: [PATCH] Update 'query_builder' option The entity used in 'FROM' clause of 'query_builder' option will always be validated against the class which you have specified in form field option 'class'. If you return another entity instead of the one used in your FROM clause, for instance SELECT an entity from a joined table, it will break validation. --- reference/forms/types/entity.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index af7992c5c8c..1fa0b9e8774 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -191,6 +191,13 @@ The value of this option can either be a ``QueryBuilder`` object, a Closure or passed the ``EntityRepository`` of the entity as the only argument and should return a ``QueryBuilder``. +.. caution:: + +   The entity used in the ``FROM`` clause of `query_builder`_ option + will always be validated against the class which you have specified with the form's `class`_ option. +   If you return another entity instead of the one used in your ``FROM`` clause + (for instance if you return an entity from a joined table) it will break validation. +     Overridden Options ------------------