Skip to content

Commit

Permalink
Merge branch '2.7' into 2.8
Browse files Browse the repository at this point in the history
Conflicts:
	reference/forms/types/entity.rst
  • Loading branch information
wouterj committed Mar 9, 2016
2 parents d85f13a + 60cd462 commit 01133fd
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 39 deletions.
8 changes: 4 additions & 4 deletions cookbook/bundles/configuration.rst
Expand Up @@ -75,7 +75,7 @@ bundle configuration would look like:
acme_social:
twitter:
client_id: 123
client_secret: $ecret
client_secret: your_secret
.. code-block:: xml
Expand All @@ -88,7 +88,7 @@ bundle configuration would look like:
http://symfony.com/schema/dic/services/services-1.0.xsd">
<acme-social:config>
<twitter client-id="123" client-secret="$ecret" />
<twitter client-id="123" client-secret="your_secret" />
</acme-social:config>
<!-- ... -->
Expand All @@ -99,7 +99,7 @@ bundle configuration would look like:
// app/config/config.php
$container->loadFromExtension('acme_social', array(
'client_id' => 123,
'client_secret' => '$ecret',
'client_secret' => 'your_secret',
));
.. seealso::
Expand Down Expand Up @@ -139,7 +139,7 @@ For the configuration example in the previous section, the array passed to your
array(
'twitter' => array(
'client_id' => 123,
'client_secret' => '$ecret',
'client_secret' => '$secret',
),
),
)
Expand Down
4 changes: 2 additions & 2 deletions cookbook/controller/error_pages.rst
Expand Up @@ -267,8 +267,8 @@ In that case, you might want to override one or both of the ``showAction()`` and
# app/config/services.yml
services:
app.exception_controller:
class: AppBundle\Controller\CustomExceptionController
arguments: ['@twig', '%kernel.debug%']
class: AppBundle\Controller\CustomExceptionController
arguments: ['@twig', '%kernel.debug%']
.. code-block:: xml
Expand Down
67 changes: 34 additions & 33 deletions reference/forms/types/entity.rst
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:`ChoiceType </reference/forms/types/choice>`: |
| 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:`FormType </reference/forms/types/form>`: |
| | |
Expand Down Expand Up @@ -118,15 +118,6 @@ then you can supply the ``choices`` option directly::
Field Options
-------------

class
~~~~~

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

The class of your entity (e.g. ``AppBundle:Category``). This can be
a fully-qualified class name (e.g. ``AppBundle\Entity\Category``)
or the short alias name (as shown prior).

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

Expand Down Expand Up @@ -180,16 +171,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. ``AppBundle:Category``). This can be
a fully-qualified class name (e.g. ``AppBundle\Entity\Category``)
or the short alias name (as shown prior).

em
~~
Expand All @@ -199,6 +188,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 @@ -224,20 +224,18 @@ Inherited Options

These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`:

.. 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 @@ -248,7 +246,7 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
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 @@ -257,7 +255,10 @@ These options inherit from the :doc:`ChoiceType </reference/forms/types/choice>`
This option expects an array of entity objects (that's actually the same as with
the ``ChoiceType`` field, whichs requires an array of the preferred "values").

These options inherit from the :doc:`FormType </reference/forms/types/form>`:
.. include:: /reference/forms/types/options/choice_type_translation_domain.rst.inc

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

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

Expand Down

0 comments on commit 01133fd

Please sign in to comment.