@@ -194,39 +194,16 @@ return a ``QueryBuilder``.
194194Overridden Options
195195------------------
196196
197- choice_name
198- ~~~~~~~~~~~
197+ .. include :: /reference/forms/types/options/choice_name.rst.inc
199198
200- .. versionadded :: 2.7
201- The ``choice_name `` option was introduced in Symfony 2.7.
202-
203- **type **: ``string ``, ``callable `` or :class: `Symfony\\ Component\\ PropertyAccess\\ PropertyPath ` **default **: id
204-
205- By default the name of each field is the id of the entity, if it can be read
206- from the class metadata by an internal id reader. Otherwise the process will
207- fall back to using increasing integers.
208-
209- choice_value
210- ~~~~~~~~~~~~
199+ In the ``EntityType ``, this defaults to the ``id `` of the entity, if it can
200+ be read. Otherwise, it falls back to using auto-incrementing integers.
211201
212- .. versionadded :: 2.7
213- The ``choice_value `` option was introduced in Symfony 2.7.
214-
215- **type **: ``string ``, ``callable `` or :class: `Symfony\\ Component\\ PropertyAccess\\ PropertyPath ` **default **: id
216-
217- As for the ``choice_name `` option, ``choice_value `` uses the id by default.
218- It allows an optimization in the :class: ``Symfony\\ Bridge\\ Doctrine\\ Form\\ ChoiceList\\ Loader\\ DoctrineChoiceLoader` ` which will
219- only load the ids passed as values while the form submission.
220- It prevents all non submitted entities to be loaded from the database, even
221- when defining the ``query_builder `` option.
222- If it may be useful to set this option using an entity's property as string
223- value (e.g for some API), you will gain performances by letting this option set
224- by default.
225-
226- .. note ::
202+ .. include :: /reference/forms/types/options/choice_value.rst.inc
227203
228- If the id cannot be read, for BC, the component checks if the class implements
229- ``__toString() `` and will use an incremental integer otherwise.
204+ In the ``EntityType ``, this is overridden to use the ``id `` by default. When the
205+ ``id `` is used, Doctrine only queries for the objects for the ids that were actually
206+ submitted.
230207
231208choices
232209~~~~~~~
0 commit comments