UuidFactoryInterface¶
-
interface
Ramsey\Uuid\
UuidFactoryInterface
¶ Represents a UUID factory.
-
getValidator
()¶ - Return type
-
uuid1
([$node[, $clockSeq]])¶ Generates a version 1, Gregorian time UUID. See Version 1: Gregorian Time.
- Parameters
$node (Ramsey\Uuid\Type\Hexadecimal|null) – An optional hexadecimal node to use
$clockSeq (int|null) – An optional clock sequence to use
- Returns
A version 1 UUID
- Return type
-
uuid2
($localDomain[, $localIdentifier[, $node[, $clockSeq]]])¶ Generates a version 2, DCE Security UUID. See Version 2: DCE Security.
- Parameters
$localDomain (int) – The local domain to use (one of
Uuid::DCE_DOMAIN_PERSON
,Uuid::DCE_DOMAIN_GROUP
, orUuid::DCE_DOMAIN_ORG
)$localIdentifier (Ramsey\Uuid\Type\Integer|null) – A local identifier for the domain (defaults to system UID or GID for person or group)
$node (Ramsey\Uuid\Type\Hexadecimal|null) – An optional hexadecimal node to use
$clockSeq (int|null) – An optional clock sequence to use
- Returns
A version 2 UUID
- Return type
-
uuid3
($ns, $name)¶ Generates a version 3, name-based (MD5) UUID. See Version 3: Name-based (MD5).
- Parameters
$ns (Ramsey\Uuid\UuidInterface|string) – The namespace for this identifier
$name (string) – The name from which to generate an identifier
- Returns
A version 3 UUID
- Return type
-
uuid4
()¶ Generates a version 4, random UUID. See Version 4: Random.
- Returns
A version 4 UUID
- Return type
-
uuid5
($ns, $name)¶ Generates a version 5, name-based (SHA-1) UUID. See Version 5: Name-based (SHA-1).
- Parameters
$ns (Ramsey\Uuid\UuidInterface|string) – The namespace for this identifier
$name (string) – The name from which to generate an identifier
- Returns
A version 5 UUID
- Return type
-
uuid6
([$node[, $clockSeq]])¶ Generates a version 6, reordered time UUID. See Version 6: Reordered Time.
- Parameters
$node (Ramsey\Uuid\Type\Hexadecimal|null) – An optional hexadecimal node to use
$clockSeq (int|null) – An optional clock sequence to use
- Returns
A version 6 UUID
- Return type
-
fromString
($uuid)¶ Creates an instance of UuidInterface from the string standard representation.
- Parameters
$uuid (string) – The string standard representation of a UUID
- Return type
-
fromBytes
($bytes)¶ Creates an instance of UuidInterface from a 16-byte string.
- Parameters
$bytes (string) – A 16-byte binary string representation of a UUID
- Return type
-
fromInteger
($integer)¶ Creates an instance of UuidInterface from a 128-bit string integer.
- Parameters
$integer (string) – A 128-bit string integer representation of a UUID
- Return type
-
fromDateTime
($dateTime[, $node[, $clockSeq]])¶ Creates a version 1 UUID instance from a DateTimeInterface instance.
- Parameters
$dateTime (DateTimeInterface) – The date from which to create the UUID instance
$node (Ramsey\Uuid\Type\Hexadecimal|null) – An optional hexadecimal node to use
$clockSeq (int|null) – An optional clock sequence to use
- Returns
A version 1 UUID
- Return type
-