OrderedTimeCodec
class OrderedTimeCodec extends StringCodec (View source)
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.
Methods
Constructs a StringCodec for use encoding and decoding UUIDs
Encodes a UuidInterface as an optimized binary representation of a UUID
Decodes a string representation of a UUID into a UuidInterface object instance
Decodes an optimized binary representation of a UUID into a UuidInterface object instance
Returns an array of UUID components (the UUID exploded on its dashes)
Details
in StringCodec at line 39
__construct(UuidBuilderInterface $builder)
Constructs a StringCodec for use encoding and decoding UUIDs
in StringCodec at line 50
string
encode(UuidInterface $uuid)
Encodes a UuidInterface as a string representation of a UUID
at line 32
string
encodeBinary(UuidInterface $uuid)
Encodes a UuidInterface as an optimized binary representation of a UUID
in StringCodec at line 77
UuidInterface
decode(string $encodedUuid)
Decodes a string representation of a UUID into a UuidInterface object instance
at line 54
UuidInterface
decodeBytes(string $bytes)
Decodes an optimized binary representation of a UUID into a UuidInterface object instance
in StringCodec at line 107
protected UuidBuilderInterface
getBuilder()
Returns the UUID builder
in StringCodec at line 118
protected array
extractComponents(string $encodedUuid)
Returns an array of UUID components (the UUID exploded on its dashes)
in StringCodec at line 155
protected array
getFields(array $components)
Returns the fields that make up this UUID