Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2d7f46c

Browse files
committed
minor#20817 [Clock] documentDatePointType (garak)
This PR was merged into the 7.3 branch.Discussion----------[Clock] document `DatePointType`Fix#20807Commits-------0dd6f34 document DatePointType
2 parents0d01dbc +0dd6f34 commit2d7f46c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

‎components/clock.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
272297
Writing Time-Sensitive Tests
273298
----------------------------
274299

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp