From 742ce13d0a305617bedf0d269bcaf4ab54359e0a Mon Sep 17 00:00:00 2001 From: lacatoire Date: Tue, 27 Jan 2026 15:43:17 +0100 Subject: [PATCH] docs(uid): clarify Doctrine UUID generator usage --- components/uid.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/components/uid.rst b/components/uid.rst index 4b6938e98d..855a85b0aa 100644 --- a/components/uid.rst +++ b/components/uid.rst @@ -350,6 +350,19 @@ entity primary keys:: // ... } +.. note:: + + When using DoctrineBundle, using ``UuidGenerator::class`` creates a new + generator instance and does **not** use the ``doctrine.uuid_generator`` + service. As a result, the UUID version configured via the FrameworkBundle + (for example UUIDv6 or UUIDv7) is ignored. + +When working with DoctrineBundle, prefer using the generator service instead:: + + #[ORM\Id] + #[ORM\Column(type: 'uuid', unique: true)] + #[ORM\GeneratedValue(strategy: 'CUSTOM')] + #[ORM\CustomIdGenerator('doctrine.uuid_generator')] .. warning::