Skip to content

Commit c3528fd

Browse files
committed
minor symfony#6267 [Form] fix 'data_class' option in EntityType (HeahDude)
This PR was merged into the 2.3 branch. Discussion ---------- [Form] fix 'data_class' option in EntityType `data_class` option in kind of overridden as it is not used in `EntityType` in favor of required `class` option. Commits ------- 2ac70f7 fix 'data_class' option in EntityType
2 parents 934aad5 + 2ac70f7 commit c3528fd

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

reference/forms/types/entity.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ objects from the database.
1313
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
1414
+-------------+------------------------------------------------------------------+
1515
| Options | - `class`_ |
16-
| | - `data_class`_ |
1716
| | - `em`_ |
1817
| | - `group_by`_ |
1918
| | - `property`_ |
2019
| | - `query_builder`_ |
2120
+-------------+------------------------------------------------------------------+
2221
| Overridden | - `choice_list`_ |
2322
| options | - `choices`_ |
23+
| | - `data_class`_ |
2424
+-------------+------------------------------------------------------------------+
2525
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type: |
2626
| options | |
@@ -112,8 +112,6 @@ The class of your entity (e.g. ``AcmeStoreBundle:Category``). This can be
112112
a fully-qualified class name (e.g. ``Acme\StoreBundle\Entity\Category``)
113113
or the short alias name (as shown prior).
114114

115-
.. include:: /reference/forms/types/options/data_class.rst.inc
116-
117115
em
118116
~~
119117

@@ -125,7 +123,7 @@ instead of the default entity manager.
125123
group_by
126124
~~~~~~~~
127125

128-
**type**: ``string``
126+
**type**: ``string`` **default** ``null``
129127

130128
This is a property path (e.g. ``author.name``) used to organize the
131129
available choices in groups. It only works when rendered as a select tag
@@ -136,7 +134,7 @@ the select tag, without a surrounding optgroup.
136134
property
137135
~~~~~~~~
138136

139-
**type**: ``string``
137+
**type**: ``string`` **default**: ``null``
140138

141139
This is the property that should be used for displaying the entities
142140
as text in the HTML element. If left blank, the entity object will be
@@ -175,9 +173,9 @@ choice_list
175173

176174
**default**: :class:`Symfony\\Bridge\\Doctrine\\Form\\ChoiceList\\EntityChoiceList`
177175

178-
The purpose of the ``entity`` type is to create and configure this ``EntityChoiceList``
179-
for you, by using all of the above options. If you need to override this
180-
option, you may just consider using the :doc:`/reference/forms/types/choice`
176+
The purpose of the ``entity`` type is to create and configure this
177+
``EntityChoiceList`` for you, by using all of the above options. If you need
178+
to override this option, you may just consider using the :doc:`/reference/forms/types/choice`
181179
directly.
182180

183181
choices
@@ -189,6 +187,14 @@ Instead of allowing the `class`_ and `query_builder`_ options to fetch the
189187
entities to include for you, you can pass the ``choices`` option directly.
190188
See :ref:`reference-forms-entity-choices`.
191189

190+
data_class
191+
~~~~~~~~~~
192+
193+
**type**: ``string`` **default**: ``null``
194+
195+
This option is not used in favor of the ``class`` option which is required
196+
to query the entities.
197+
192198
Inherited Options
193199
-----------------
194200

0 commit comments

Comments
 (0)