Skip to content

Commit bab634b

Browse files
JonathanJonathan Klauck
Jonathan
authored and
Jonathan Klauck
committed
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.
1 parent 1c7ddc9 commit bab634b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

reference/forms/types/entity.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ The value of this option can either be a ``QueryBuilder`` object, a Closure or
191191
passed the ``EntityRepository`` of the entity as the only argument and should
192192
return a ``QueryBuilder``.
193193

194+
.. caution::
195+
196+
  The entity used in the ``FROM`` clause of `query_builder`_ option
197+
will always be validated against the class which you have specified with the form's `class`_ option.
198+
  If you return another entity instead of the one used in your ``FROM`` clause
199+
(for instance if you return an entity from a joined table) it will break validation.
200+
   
194201
Overridden Options
195202
------------------
196203

0 commit comments

Comments
 (0)