File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -269,6 +269,31 @@ timestamps::
269269
270270.. _clock_writing-tests :
271271
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+
272297Writing Time-Sensitive Tests
273298----------------------------
274299
You can’t perform that action at this time.
0 commit comments