docs(uid): clarify Doctrine UUID generator usage

This commit is contained in:
lacatoire
2026-01-27 15:43:17 +01:00
committed by Javier Eguiluz
parent 867dc8e179
commit 742ce13d0a

View File

@@ -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::