Skip to content

UuidInterface

Also known as a Leach-Salz variant UUID, an RFC 4122 variant UUID is a universally unique identifier defined by RFC 4122

  • Full name: \Ramsey\Uuid\Rfc4122\UuidInterface
  • Parent interfaces: \Ramsey\Uuid\UuidInterface See Also:

  • https://tools.ietf.org/html/rfc4122 - RFC 4122

Inherited methods

getNumberConverter

public getNumberConverter(): \Ramsey\Uuid\Converter\NumberConverterInterface
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getFieldsHex

public getFieldsHex(): string[]
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getClockSeqHiAndReservedHex

public getClockSeqHiAndReservedHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getClockSeqLowHex

public getClockSeqLowHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getClockSequenceHex

public getClockSequenceHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getDateTime

public getDateTime(): \DateTimeInterface
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getLeastSignificantBitsHex

public getLeastSignificantBitsHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getMostSignificantBitsHex

public getMostSignificantBitsHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getNodeHex

public getNodeHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getTimeHiAndVersionHex

public getTimeHiAndVersionHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getTimeLowHex

public getTimeLowHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getTimeMidHex

public getTimeMidHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getTimestampHex

public getTimestampHex(): string
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getVariant

public getVariant(): ?int
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

getVersion

public getVersion(): ?int
  • Warning: this method is deprecated. This means that this method will likely be removed in a future version.

compareTo

Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than the other UUID

public compareTo(\Ramsey\Uuid\UuidInterface $other): int<-1, 1>

The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is greater for the first UUID.

  • Q. What's the value of being able to sort UUIDs?
  • A. Use them as keys in a B-Tree or similar mapping.

Parameters:

Parameter Type Description
$other \Ramsey\Uuid\UuidInterface The UUID to compare

Return Value:

-1, 0, or 1 if the UUID is less than, equal to, or greater than $other


equals

Returns true if the UUID is equal to the provided object

public equals(object|null $other): bool

The result is true if and only if the argument is not null, is a UUID object, has the same variant, and contains the same value, bit for bit, as the UUID.

Parameters:

Parameter Type Description
$other object|null An object to test for equality with this UUID

Return Value:

True if the other object is equal to this UUID


getBytes

Returns the binary string representation of the UUID

public getBytes(): string

getFields

Returns the fields that comprise this UUID

public getFields(): \Ramsey\Uuid\Fields\FieldsInterface

getHex

Returns the hexadecimal representation of the UUID

public getHex(): \Ramsey\Uuid\Type\Hexadecimal

getInteger

Returns the integer representation of the UUID

public getInteger(): \Ramsey\Uuid\Type\Integer

getUrn

Returns the string standard representation of the UUID as a URN

public getUrn(): string

See Also:

  • http://en.wikipedia.org/wiki/Uniform_Resource_Name - Uniform Resource Name* https://tools.ietf.org/html/rfc4122#section-3 - RFC 4122, ยง 3: Namespace Registration Template

toString

Returns the string standard representation of the UUID

public toString(): string

__toString

Casts the UUID to the string standard representation

public __toString(): string


Automatically generated on 2025-03-18