Skip to content

Commit

Permalink
minor #6267 [Form] fix 'data_class' option in EntityType (HeahDude)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wouterj committed Mar 5, 2016
2 parents 934aad5 + 2ac70f7 commit c3528fd
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ objects from the database.
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+------------------------------------------------------------------+
| Options | - `class`_ |
| | - `data_class`_ |
| | - `em`_ |
| | - `group_by`_ |
| | - `property`_ |
| | - `query_builder`_ |
+-------------+------------------------------------------------------------------+
| Overridden | - `choice_list`_ |
| options | - `choices`_ |
| | - `data_class`_ |
+-------------+------------------------------------------------------------------+
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type: |
| options | |
Expand Down Expand Up @@ -112,8 +112,6 @@ The class of your entity (e.g. ``AcmeStoreBundle:Category``). This can be
a fully-qualified class name (e.g. ``Acme\StoreBundle\Entity\Category``)
or the short alias name (as shown prior).

.. include:: /reference/forms/types/options/data_class.rst.inc

em
~~

Expand All @@ -125,7 +123,7 @@ instead of the default entity manager.
group_by
~~~~~~~~

**type**: ``string``
**type**: ``string`` **default** ``null``

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

**type**: ``string``
**type**: ``string`` **default**: ``null``

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

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

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

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

data_class
~~~~~~~~~~

**type**: ``string`` **default**: ``null``

This option is not used in favor of the ``class`` option which is required
to query the entities.

Inherited Options
-----------------

Expand Down

0 comments on commit c3528fd

Please sign in to comment.