Skip to content

Commit

Permalink
minor #6330 [Form] reorder EntityType options (HeahDude)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] reorder EntityType options

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.7+
| Fixed tickets | #6261 (rest)

Commits
-------

30a1495 [Form] reorder EntityType options
  • Loading branch information
wouterj committed Mar 8, 2016
2 parents 79e0d0d + 30a1495 commit a99cc60
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ objects from the database.
+-------------+------------------------------------------------------------------+
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+------------------------------------------------------------------+
| Options | - `class`_ |
| | - `choice_label`_ |
| | - `query_builder`_ |
| Options | - `choice_label`_ |
| | - `class`_ |
| | - `em`_ |
| | - `query_builder`_ |
+-------------+------------------------------------------------------------------+
| Overridden | - `choices`_ |
| options | - `data_class`_ |
+-------------+------------------------------------------------------------------+
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type: |
| options | |
| | - `choice_value`_ |
| | - `choice_name`_ |
| | - `choice_attr`_ |
| | - `placeholder`_ |
| | - `choice_name`_ |
| | - `choice_translation_domain`_ |
| | - `translation_domain`_ |
| | - `choice_value`_ |
| | - `expanded`_ |
| | - `group_by`_ |
| | - `multiple`_ |
| | - `placeholder`_ |
| | - `preferred_choices`_ |
| | - `group_by`_ |
| | - `translation_domain`_ |
| | |
| | from the :doc:`form </reference/forms/types/form>` type: |
| | |
Expand Down Expand Up @@ -108,15 +108,6 @@ then you can supply the ``choices`` option directly::
Field Options
-------------

class
~~~~~

**type**: ``string`` **required**

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).

choice_label
~~~~~~~~~~~~

Expand Down Expand Up @@ -161,16 +152,14 @@ more detais, see the main :ref:`choice_label <reference-form-choice-label>` docu
'choice_label' => 'translations[en].name',
));

query_builder
~~~~~~~~~~~~~
class
~~~~~

**type**: ``Doctrine\ORM\QueryBuilder`` or a Closure
**type**: ``string`` **required**

If specified, this is used to query the subset of options (and their
order) that should be used for the field. The value of this option can
either be a ``QueryBuilder`` object or a Closure. If using a Closure,
it should take a single argument, which is the ``EntityRepository`` of
the entity and return an instance of ``QueryBuilder``.
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).

em
~~
Expand All @@ -180,6 +169,17 @@ em
If specified, this entity manager will be used to load the choices
instead of the ``default`` entity manager.

query_builder
~~~~~~~~~~~~~

**type**: ``Doctrine\ORM\QueryBuilder`` or a Closure

If specified, this is used to query the subset of options (and their
order) that should be used for the field. The value of this option can
either be a ``QueryBuilder`` object or a Closure. If using a Closure,
it should take a single argument, which is the ``EntityRepository`` of
the entity and return an instance of ``QueryBuilder``.

Overridden Options
------------------

Expand All @@ -206,20 +206,18 @@ Inherited Options
These options inherit from the :doc:`choice </reference/forms/types/choice>`
type:

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

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

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

.. include:: /reference/forms/types/options/placeholder.rst.inc
.. include:: /reference/forms/types/options/choice_name.rst.inc

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

.. include:: /reference/forms/types/options/choice_type_translation_domain.rst.inc
.. include:: /reference/forms/types/options/choice_value.rst.inc

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

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

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

.. note::
Expand All @@ -230,7 +228,7 @@ type:
is a complete example in the cookbook article
:doc:`/cookbook/form/form_collections`.

.. include:: /reference/forms/types/options/group_by.rst.inc
.. include:: /reference/forms/types/options/placeholder.rst.inc

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

Expand All @@ -239,6 +237,8 @@ type:
This option expects an array of entity objects, unlike the ``choice``
field that requires an array of keys.

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

These options inherit from the :doc:`form </reference/forms/types/form>`
type:

Expand Down

0 comments on commit a99cc60

Please sign in to comment.