Documentation

TimestampFirstCombCodec extends StringCodec
in package

TimestampFirstCombCodec encodes and decodes COMB UUIDs which have the timestamp as the first 48 bits.

To be used with MySQL, PostgreSQL, Oracle.

Table of Contents

$builder  : UuidBuilderInterface
__construct()  : mixed
Constructs a StringCodec for use encoding and decoding UUIDs
decode()  : UuidInterface
Decodes a string representation of timestamp first COMB UUID into a UuidInterface object instance
decodeBytes()  : UuidInterface
Decodes a binary representation of timestamp first COMB UUID into a UuidInterface object instance
encode()  : string
Encodes a UuidInterface as a string representation of a timestamp first COMB UUID
encodeBinary()  : string
Encodes a UuidInterface as a binary representation of timestamp first COMB UUID
extractComponents()  : array<string|int, mixed>
Returns an array of UUID components (the UUID exploded on its dashes)
getBuilder()  : UuidBuilderInterface
Returns the UUID builder
getFields()  : array<string|int, mixed>
Returns the fields that make up this UUID
swapTimestampAndRandomBits()  : void
Swaps the first 48 bits with the last 48 bits

Properties

Methods

encode()

Encodes a UuidInterface as a string representation of a timestamp first COMB UUID

public encode(UuidInterface $uuid) : string
Parameters
$uuid : UuidInterface
Return values
string

Hexadecimal string representation of a GUID

encodeBinary()

Encodes a UuidInterface as a binary representation of timestamp first COMB UUID

public encodeBinary(UuidInterface $uuid) : string
Parameters
$uuid : UuidInterface
Return values
string

Binary string representation of timestamp first COMB UUID

extractComponents()

Returns an array of UUID components (the UUID exploded on its dashes)

protected extractComponents(string $encodedUuid) : array<string|int, mixed>
Parameters
$encodedUuid : string
Tags
throws
InvalidUuidStringException
Return values
array<string|int, mixed>

getFields()

Returns the fields that make up this UUID

protected getFields(array<string|int, mixed> $components) : array<string|int, mixed>
Parameters
$components : array<string|int, mixed>
Tags
see
UuidInterface::getFieldsHex()
Return values
array<string|int, mixed>

swapTimestampAndRandomBits()

Swaps the first 48 bits with the last 48 bits

protected swapTimestampAndRandomBits(array<string|int, mixed> &$components) : void
Parameters
$components : array<string|int, mixed>

An array of UUID components (the UUID exploded on its dashes)

Return values
void

Search results