File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -53,11 +53,22 @@ to create each type of UUID::
5353 $uuid = Uuid::v3($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV3
5454 $uuid = Uuid::v5($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV5
5555
56+ // the namespaces defined by RFC 4122 are available as constants
57+ // (see https://tools.ietf.org/html/rfc4122#appendix-C)
58+ $uuid = Uuid::v3(Uuid::NAMESPACE_DNS, $name);
59+ $uuid = Uuid::v3(Uuid::NAMESPACE_URL, $name);
60+ $uuid = Uuid::v3(Uuid::NAMESPACE_OID, $name);
61+ $uuid = Uuid::v3(Uuid::NAMESPACE_X500, $name);
62+
5663 // UUID type 6 is not part of the UUID standard. It's lexicographically sortable
5764 // (like ULIDs) and contains a 60-bit timestamp and 63 extra unique bits.
5865 // It's defined in http://gh.peabody.io/uuidv6/
5966 $uuid = Uuid::v6(); // $uuid is an instance of Symfony\Component\Uid\UuidV6
6067
68+ .. versionadded :: 5.3
69+
70+ The ``Uuid::NAMESPACE_* `` constants were introduced in Symfony 5.3.
71+
6172If your UUID is generated by another system, use the ``fromString() `` method to
6273create an object and make use of the utilities available for Symfony UUIDs::
6374
You can’t perform that action at this time.
0 commit comments