Documentation

GuidStringCodec extends StringCodec
in package

GuidStringCodec encodes and decodes globally unique identifiers (GUID)

Tags
link
https://en.wikipedia.org/wiki/Globally_unique_identifier

Table of Contents

$builder  : UuidBuilderInterface
__construct()  : mixed
Constructs a StringCodec for use encoding and decoding UUIDs
decode()  : UuidInterface
Decodes a string representation of a GUID into a UuidInterface object instance
decodeBytes()  : UuidInterface
Decodes a binary representation of a GUID into a UuidInterface object instance
encode()  : string
Encodes a UuidInterface as a string representation of a GUID
encodeBinary()  : string
Encodes a UuidInterface as a binary representation of a GUID
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
swapFields()  : void
Swaps fields to support GUID byte order

Properties

Methods

encode()

Encodes a UuidInterface as a string representation of a GUID

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 a GUID

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

Binary string representation of a GUID

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>

swapFields()

Swaps fields to support GUID byte order

protected swapFields(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