Skip to content

Commit a8c0d99

Browse files
committed
minor #7220 Update 'query_builder' option (phrix32)
This PR was merged into the 2.7 branch. Discussion ---------- 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. Closes #4331 Commits ------- bab634b Update 'query_builder' option
2 parents 85093fd + bab634b commit a8c0d99

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)