From a75b30a200ed9f7b4ca15f4cd19ac4926b7ca3eb Mon Sep 17 00:00:00 2001 From: Denys Pasishnyi Date: Sat, 14 Dec 2013 15:26:41 +0100 Subject: [PATCH 1/5] Create data_class.rst.inc #2362 Create data_class documentation. --- reference/forms/types/options/data_class.rst.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 reference/forms/types/options/data_class.rst.inc diff --git a/reference/forms/types/options/data_class.rst.inc b/reference/forms/types/options/data_class.rst.inc new file mode 100644 index 00000000000..8ec4c003bee --- /dev/null +++ b/reference/forms/types/options/data_class.rst.inc @@ -0,0 +1,11 @@ +data_class +~~~~~~~~~~ + +**type**: ``string`` + +This option is used to set the appropriate data mapper to be used by the form, so you can use it for any form field type which requires an object. + + $builder->add('media', 'sonata_media_type', array( + 'data_class' => 'Acme\DemoBundle\Entity\Media', + )); + From cabb2ac9604283a39e9b11213817f671da23c851 Mon Sep 17 00:00:00 2001 From: Denys Pasishnyi Date: Mon, 16 Dec 2013 16:13:20 +0100 Subject: [PATCH 2/5] Wrap the content and remove empty space. --- reference/forms/types/options/data_class.rst.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/options/data_class.rst.inc b/reference/forms/types/options/data_class.rst.inc index 8ec4c003bee..bf9358ec724 100644 --- a/reference/forms/types/options/data_class.rst.inc +++ b/reference/forms/types/options/data_class.rst.inc @@ -3,9 +3,9 @@ data_class **type**: ``string`` -This option is used to set the appropriate data mapper to be used by the form, so you can use it for any form field type which requires an object. +This option is used to set the appropriate data mapper to be used by the form, +so you can use it for any form field type which requires an object. $builder->add('media', 'sonata_media_type', array( 'data_class' => 'Acme\DemoBundle\Entity\Media', )); - From 13cd6c2fd033e52e69e4e32b7ad16cf5ae54b6b8 Mon Sep 17 00:00:00 2001 From: Denys Pasishnyi Date: Mon, 16 Dec 2013 17:23:52 +0100 Subject: [PATCH 3/5] Add "data_class" option description #3334 --- reference/forms/types/entity.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 29b73c2b4af..6ef60af7bb9 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -13,6 +13,7 @@ objects from the database. | Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) | +-------------+------------------------------------------------------------------+ | Options | - `class`_ | +| | - `data_class`_ | | | - `property`_ | | | - `group_by`_ | | | - `query_builder`_ | @@ -103,6 +104,8 @@ 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 + property ~~~~~~~~ From 9b1ad11e0d185e8c48884a4fe58c3fb2bbd724f3 Mon Sep 17 00:00:00 2001 From: Denys Pasishnyi Date: Tue, 17 Dec 2013 12:19:33 +0100 Subject: [PATCH 4/5] Add versionadded directive --- reference/forms/types/options/data_class.rst.inc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reference/forms/types/options/data_class.rst.inc b/reference/forms/types/options/data_class.rst.inc index bf9358ec724..3636dbf13d6 100644 --- a/reference/forms/types/options/data_class.rst.inc +++ b/reference/forms/types/options/data_class.rst.inc @@ -1,3 +1,6 @@ +.. versionadded:: 2.4 + The ``data_class`` option was introduced in Symfony 2.4. + data_class ~~~~~~~~~~ From e28cda65c074a581ace626bdd2d317e10de85424 Mon Sep 17 00:00:00 2001 From: Denys Pasishnyi Date: Tue, 17 Dec 2013 12:22:45 +0100 Subject: [PATCH 5/5] Add description about "data_class" option #3334 --- reference/forms/types/form.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/forms/types/form.rst b/reference/forms/types/form.rst index b51fe597078..1628c93fc2f 100644 --- a/reference/forms/types/form.rst +++ b/reference/forms/types/form.rst @@ -11,6 +11,8 @@ on all fields. .. include:: /reference/forms/types/options/data.rst.inc +.. include:: /reference/forms/types/options/data_class.rst.inc + .. include:: /reference/forms/types/options/required.rst.inc .. include:: /reference/forms/types/options/constraints.rst.inc