Documentation

OrderedTimeCodec extends StringCodec
in package

OrderedTimeCodec optimizes the bytes to increment UUIDs when time goes by, to improve database INSERTs.

The string value will be unchanged from StringCodec. Only works for UUID type 1.

Table of Contents

$builder  : UuidBuilderInterface
__construct()  : mixed
Constructs a StringCodec for use encoding and decoding UUIDs
decode()  : UuidInterface
Decodes a string representation of a UUID into a UuidInterface object instance
decodeBytes()  : UuidInterface
Decodes an optimized binary representation of a UUID into a UuidInterface object instance
encode()  : string
Encodes a UuidInterface as a string representation of a UUID
encodeBinary()  : string
Encodes a UuidInterface as an optimized binary representation of a 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

Properties

Methods

decodeBytes()

Decodes an optimized binary representation of a UUID into a UuidInterface object instance

public decodeBytes(string $bytes) : UuidInterface
Parameters
$bytes : string
Tags
throws
InvalidArgumentException

if string has not 16 characters

Return values
UuidInterface

encode()

Encodes a UuidInterface as a string representation of a UUID

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

Hexadecimal string representation of a UUID

encodeBinary()

Encodes a UuidInterface as an optimized binary representation of a UUID

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

Binary string representation of a 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>

Search results