Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form] fix 'data_class' option in EntityType #6267

Merged
merged 1 commit into from
Mar 5, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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