Skip to content

Commit f22edae

Browse files
author
Jonathan
authored
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 b06a83a commit f22edae

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
@@ -203,6 +203,13 @@ passed the ``EntityRepository`` of the entity as the only argument and should
203203
return a ``QueryBuilder``. Returning ``null`` in the Closure will result in
204204
loading all entities.
205205

206+
.. caution::
207+
208+
  The entity used in ``FROM`` clause of `query_builder`_ option
209+
will always be validated against the class which you have specified in form field option `class`_.
210+
  If you return another entity instead of the one used in your ``FROM`` clause,
211+
for instance ``SELECT`` an entity from a joined table, it will break validation.
212+
   
206213
Overridden Options
207214
------------------
208215

0 commit comments

Comments
 (0)