File tree 1 file changed +11
-0
lines changed
Filter options
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::
53
53
$uuid = Uuid::v3($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV3
54
54
$uuid = Uuid::v5($namespace, $name); // $uuid is an instance of Symfony\Component\Uid\UuidV5
55
55
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
+
56
63
// UUID type 6 is not part of the UUID standard. It's lexicographically sortable
57
64
// (like ULIDs) and contains a 60-bit timestamp and 63 extra unique bits.
58
65
// It's defined in http://gh.peabody.io/uuidv6/
59
66
$uuid = Uuid::v6(); // $uuid is an instance of Symfony\Component\Uid\UuidV6
60
67
68
+ .. versionadded :: 5.3
69
+
70
+ The ``Uuid::NAMESPACE_* `` constants were introduced in Symfony 5.3.
71
+
61
72
If your UUID is generated by another system, use the ``fromString() `` method to
62
73
create an object and make use of the utilities available for Symfony UUIDs::
63
74
You can’t perform that action at this time.
0 commit comments