diff --git a/components/uid.rst b/components/uid.rst index 076946c7756..51f8b4021a2 100644 --- a/components/uid.rst +++ b/components/uid.rst @@ -53,11 +53,22 @@ to create each type of UUID:: $uuid = Uuid::v3($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV3 $uuid = Uuid::v5($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV5 + // the namespaces defined by RFC 4122 are available as constants + // (see https://tools.ietf.org/html/rfc4122#appendix-C) + $uuid = Uuid::v3(Uuid::NAMESPACE_DNS, $name); + $uuid = Uuid::v3(Uuid::NAMESPACE_URL, $name); + $uuid = Uuid::v3(Uuid::NAMESPACE_OID, $name); + $uuid = Uuid::v3(Uuid::NAMESPACE_X500, $name); + // UUID type 6 is not part of the UUID standard. It's lexicographically sortable // (like ULIDs) and contains a 60-bit timestamp and 63 extra unique bits. // It's defined in http://gh.peabody.io/uuidv6/ $uuid = Uuid::v6(); // $uuid is an instance of Symfony\Component\Uid\UuidV6 +.. versionadded:: 5.3 + + The ``Uuid::NAMESPACE_*`` constants were introduced in Symfony 5.3. + If your UUID is generated by another system, use the ``fromString()`` method to create an object and make use of the utilities available for Symfony UUIDs::