8000 Allowed to return null for query_builder · JonEastman/symfony-docs@a0e3eec · GitHub
[go: up one dir, main page]

Skip to content

Commit a0e3eec

Browse files
committed
Allowed to return null for query_builder
| Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.8 | Fixed tickets | symfony#5934
1 parent 9916abf commit a0e3eec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

reference/forms/types/entity.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ 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``. If you'd like to display a list of empty entries, you can return null in the query_builder closure.
208208

209209
Overridden Options
210210
------------------

0 commit comments

Comments
 (0)
0