Skip to content

Commit 515b414

Browse files
committed
apply review suggestions
1 parent db34cce commit 515b414

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

components/clock.rst

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -75,29 +75,6 @@ When using the Clock component, you manipulate
7575
:class:`Symfony\\Component\\Clock\\DatePoint` instances. You can learn more
7676
about it in :ref:`the dedicated section <clock_date-point>`.
7777

78-
Storing DatePoints in Databases
79-
-------------------------------
80-
81-
If you :doc:`use Doctrine </doctrine>`, consider using the ``date_point`` Doctrine
82-
type, which converts to/from DatePoint objects automatically::
83-
84-
// src/Entity/Product.php
85-
namespace App\Entity;
86-
87-
use Doctrine\ORM\Mapping as ORM;
88-
use Symfony\Bridge\Doctrine\Types\DatePointType;
89-
use Symfony\Component\Clock\DatePoint;
90-
91-
#[ORM\Entity(repositoryClass: ProductRepository::class)]
92-
class Product
93-
{
94-
#[ORM\Column(type: DatePointType::NAME)]
95-
private DatePoint $created;
96-
97-
// ...
98-
}
99-
100-
10178
Available Clocks Implementations
10279
--------------------------------
10380

@@ -292,6 +269,31 @@ timestamps::
292269

293270
.. _clock_writing-tests:
294271

272+
Storing DatePoints in Databases
273+
-------------------------------
274+
275+
If you :doc:`use Doctrine </doctrine>`, consider using the ``date_point`` Doctrine
276+
type, which converts to/from ``DatePoint`` objects automatically::
277+
278+
// src/Entity/Product.php
279+
namespace App\Entity;
280+
281+
use Doctrine\ORM\Mapping as ORM;
282+
use Symfony\Component\Clock\DatePoint;
283+
284+
#[ORM\Entity]
285+
class Product
286+
{
287+
#[ORM\Column]
288+
private DatePoint $created;
289+
290+
// ...
291+
}
292+
293+
.. versionadded:: 7.3
294+
The `DatePointType` was introduced in Symfony 7.3.
295+
296+
295297
Writing Time-Sensitive Tests
296298
----------------------------
297299

0 commit comments

Comments
 (0)