From ab58080ba07f9d89dac3f0a5d141899816ece437 Mon Sep 17 00:00:00 2001 From: Yonel Ceruto Date: Wed, 18 Oct 2017 16:24:27 -0400 Subject: [PATCH 1/2] Changing type definition Closure by callable To avoid confusion I suggest be consistent according to its own definition https://github.com/symfony/symfony/blob/f1468c48a5afc745899de48621465d29494ba086/src/Symfony/Bridge/Doctrine/Form/Type/EntityType.php#L43 --- reference/forms/types/entity.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 6964471a9e7..bd4c5445712 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -181,13 +181,13 @@ instead of the ``default`` entity manager. query_builder ~~~~~~~~~~~~~ -**type**: ``Doctrine\ORM\QueryBuilder`` or a Closure **default**: ``null`` +**type**: ``Doctrine\ORM\QueryBuilder`` or a ``callable`` **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, a Closure or -``null`` (which will load all entities). When using a Closure, you will be +The value of this option can either be a ``QueryBuilder`` object, a ``callable`` or +``null`` (which will load all entities). When using a ``callable``, you will be passed the ``EntityRepository`` of the entity as the only argument and should return a ``QueryBuilder``. From fb64173a62b52a9a56a7467598c076d575df0492 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Thu, 19 Oct 2017 08:34:41 +0200 Subject: [PATCH 2/2] Minor syntax issue In other docs, we wrap "callable" with quotes only in the option definition, not in the description. I made this change to be consistent ... but we can reconsider this if you disagree. Thanks! --- reference/forms/types/entity.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index bd4c5445712..b11f463ca9e 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -186,8 +186,8 @@ query_builder 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, a ``callable`` or -``null`` (which will load all entities). When using a ``callable``, you will be +The value of this option can either be a ``QueryBuilder`` object, a callable or +``null`` (which will load all entities). When using a callable, you will be passed the ``EntityRepository`` of the entity as the only argument and should return a ``QueryBuilder``.