mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-24 00:32:14 +01:00
docs(uid): clarify Doctrine UUID generator usage
This commit is contained in:
committed by
Javier Eguiluz
parent
867dc8e179
commit
742ce13d0a
@@ -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::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user