Skip to content

Commit c389bc9

Browse files
committed
addressed @xabbuh comments
1 parent 1d058a5 commit c389bc9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

reference/forms/types/entity.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ choice_name
193193

194194
By default the name of each field is the id of the entity, if it can be read
195195
from the class metadata by an internal id reader. Otherwise the process will
196-
fall back on an incremental integer.
196+
fall back to using increasing integers.
197197

198198
choice_value
199199
~~~~~~~~~~~~
@@ -203,12 +203,14 @@ choice_value
203203

204204
**type**: ``string``, ``callable`` or :class:`Symfony\\Component\\PropertyAccess\\PropertyPath` **default**: id
205205

206-
As for the ``choice_name`` option, ``choice_value`` use the id by default.
206+
As for the ``choice_name`` option, ``choice_value`` uses the id by default.
207207
It allows an optimization in the :class:``Symfony\\Bridge\\Doctrine\\Form\\ChoiceList\\Loader\\DoctrineChoiceLoader`` which will
208-
only load the ids passed as values while the form submission, preventing all entities,
209-
even with a custom ``query_builder`` to be loaded.
210-
If it can be usefull for API to use an entity property as string value, you
211-
will gain performances by letting this option set by default.
208+
only load the ids passed as values while the form submission.
209+
It prevents all non submitted entities to be loaded from the database, even
210+
when defining the ``query_builder`` option.
211+
If it may be useful to set this option using an entity's property as string
212+
value (e.g for some API), you will gain performances by letting this option set
213+
by default.
212214

213215
.. note::
214216

0 commit comments

Comments
 (0)