Skip to content

Commit 1d058a5

Browse files
committed
addressed @javiereguiluz comment
1 parent 43252bc commit 1d058a5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

reference/forms/types/entity.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ choice_name
191191

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

194-
By default the name of each field is the id of the entity, if it can be get in
195-
the class metadata by an internal id reader.
194+
By default the name of each field is the id of the entity, if it can be read
195+
from the class metadata by an internal id reader. Otherwise the process will
196+
fall back on an incremental integer.
196197

197198
choice_value
198199
~~~~~~~~~~~~
@@ -209,6 +210,11 @@ even with a custom ``query_builder`` to be loaded.
209210
If it can be usefull for API to use an entity property as string value, you
210211
will gain performances by letting this option set by default.
211212

213+
.. note::
214+
215+
If the id cannot be read, for BC, the component checks if the class implements
216+
``__toString()`` and will use an incremental integer otherwise.
217+
212218
choices
213219
~~~~~~~
214220

0 commit comments

Comments
 (0)