Skip to content

Commit 3f9cf0b

Browse files
committed
feature #6594 Allowed to return null for query_builder (JonEastman)
This PR was squashed before being merged into the 2.8 branch (closes #6594). Discussion ---------- Allowed to return null for query_builder | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.8 | Fixed tickets | #5934 Commits ------- f84a1eb Allowed to return null for query_builder
2 parents daaa466 + f84a1eb commit 3f9cf0b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reference/forms/types/entity.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@ query_builder
202202
Allows you to create a custom query for your choices. See
203203
:ref:`ref-form-entity-query-builder` for an example.
204204

205-
The value of this option can either be a ``QueryBuilder`` object or a Closure.
205+
The value of this option can either be a ``QueryBuilder`` object, a Closure or ``null``.
206206
When using a Closure, you will be passed the ``EntityRepository`` of the entity
207-
as the only argument and should return a ``QueryBuilder``.
207+
as the only argument and should return a ``QueryBuilder``.
208+
If you'd like to display a list of empty entries, you can return ``null`` in the closure.
208209

209210
Overridden Options
210211
------------------

0 commit comments

Comments
 (0)