@@ -75,29 +75,6 @@ When using the Clock component, you manipulate
75
75
:class: `Symfony\\ Component\\ Clock\\ DatePoint ` instances. You can learn more
76
76
about it in :ref: `the dedicated section <clock_date-point >`.
77
77
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
-
101
78
Available Clocks Implementations
102
79
--------------------------------
103
80
@@ -292,6 +269,31 @@ timestamps::
292
269
293
270
.. _clock_writing-tests :
294
271
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
+
295
297
Writing Time-Sensitive Tests
296
298
----------------------------
297
299
0 commit comments