From 45f586bb47e274ed46edff1f70274b49d539c82d Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Sat, 21 May 2016 16:40:24 +0200 Subject: [PATCH] Fixed query_builder option --- reference/forms/types/entity.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index fa7bba98bde..4d93e776a45 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -166,12 +166,13 @@ cast into a string and so must have a ``__toString()`` method. query_builder ~~~~~~~~~~~~~ -**type**: ``Doctrine\ORM\QueryBuilder`` or a Closure +**type**: ``Doctrine\ORM\QueryBuilder`` or a Closure **default**: ``null`` Allows you to create a custom query for your choices. See :ref:`ref-form-entity-query-builder` for an example. -The value of this option can either be a ``QueryBuilder`` object or a Closure. +The value of this option can either be a ``QueryBuilder`` object, a Closure or +``null`` by default which loads all entities. When using a Closure, you will be passed the ``EntityRepository`` of the entity as the only argument and should return a ``QueryBuilder``.