Skip to content

Commit

Permalink
Extracted the common "data_class" option explanation for data-related…
Browse files Browse the repository at this point in the history
… types
  • Loading branch information
javiereguiluz committed Jun 4, 2015
1 parent f44e971 commit 48b402b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 16 deletions.
9 changes: 1 addition & 8 deletions reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,7 @@ The ``DateTime`` classes are treated as immutable objects.

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

data_class
~~~~~~~~~~

**default**: ``null``

The internal normalized representation of this type is an array, not a ``\DateTime``
object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid
the ``FormType`` object from initializing it to ``\DateTime``.
.. include:: /reference/forms/types/options/data_class_date.rst.inc

error_bubbling
~~~~~~~~~~~~~~
Expand Down
24 changes: 24 additions & 0 deletions reference/forms/types/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
+----------------------+-----------------------------------------------------------------------------+
| Rendered as | single text box or three select fields |
+----------------------+-----------------------------------------------------------------------------+
| Overridden Options | - `by_reference`_ |
| | - `compound`_ |
| | - `data_class`_ |
| | - `error_bubbling`_ |
+----------------------+-----------------------------------------------------------------------------+
| Options | - `date_format`_ |
| | - `date_widget`_ |
| | - `days`_ |
Expand Down Expand Up @@ -46,6 +51,25 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array.
| Class | :class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\DateTimeType` |
+----------------------+-----------------------------------------------------------------------------+

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

by_reference
~~~~~~~~~~~~

**default**: ``false``

The ``DateTime`` classes are treated as immutable objects.

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

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

error_bubbling
~~~~~~~~~~~~~~

**default**: ``false``

Field Options
-------------

Expand Down
8 changes: 8 additions & 0 deletions reference/forms/types/options/data_class_date.rst.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
data_class
~~~~~~~~~~

**default**: ``null``

The internal normalized representation of this type is an array, not a ``\DateTime``
object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid
the ``FormType`` object from initializing it to ``\DateTime``.
9 changes: 1 addition & 8 deletions reference/forms/types/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,7 @@ The ``DateTime`` classes are treated as immutable objects.

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

data_class
~~~~~~~~~~

**default**: ``null``

The internal normalized representation of this type is an array, not a ``\DateTime``
object. Therefore, the ``data_class`` option is initialized to ``null`` to avoid
the ``FormType`` object from initializing it to ``\DateTime``.
.. include:: /reference/forms/types/options/data_class_date.rst.inc

error_bubbling
~~~~~~~~~~~~~~
Expand Down

0 comments on commit 48b402b

Please sign in to comment.