We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0d01dbc commit 0dd6f34Copy full SHA for 0dd6f34
components/clock.rst
@@ -269,6 +269,31 @@ timestamps::
269
270
.. _clock_writing-tests:
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
295
+ The `DatePointType` was introduced in Symfony 7.3.
296
297
Writing Time-Sensitive Tests
298
----------------------------
299
0 commit comments