diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 94de40e854a..e73cfa13845 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -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 ` 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 ` type: | | | | @@ -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 ~~~~~~~~~~~~ @@ -161,16 +152,14 @@ more detais, see the main :ref:`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 ~~ @@ -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 ------------------ @@ -206,20 +206,18 @@ Inherited Options These options inherit from the :doc:`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:: @@ -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 @@ -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 ` type: