Skip to content

Commit f84a1eb

Browse files
JonEastmanwouterj
authored andcommitted
Allowed to return null for query_builder
1 parent 9916abf commit f84a1eb

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)