Overview

Namespaces

  • NGS
    • Client
      • Exception
    • Converter
    • Patterns
  • PHP

Classes

  • BigDecimal
  • BigInt
  • ByteStream
  • LocalDate
  • Location
  • Money
  • Name
  • Point
  • S3
  • Timestamp
  • Utils
  • UUID
  • Overview
  • Namespace
  • Class
  • Tree

Class UUID

UUID implementation

Namespace: NGS
Located at UUID.php
Methods summary
public
# __construct( null|string|NGS\UUID $value = null )

Constructs new UUID from UUID string, existing instance, or by generating version 4 UUID

Constructs new UUID from UUID string, existing instance, or by generating version 4 UUID

Parameters

$value
null|string|NGS\UUID

Throws

InvalidArgumentException
public static array
# toArray( array $items, mixed $allowNullValues = false )

Creates array of UUIDs from array by constructing UUID instance from each element of array as __construct argument. arguments

Creates array of UUIDs from array by constructing UUID instance from each element of array as __construct argument. arguments

Parameters

$items
array
$items
$allowNullValues

Returns

array
Array of UUID instances

Throws

InvalidArgumentException
public string
# __get( string $name )

Allows accessing UUID string value as property, e.g. $instance->value

Allows accessing UUID string value as property, e.g. $instance->value

Parameters

$name
string
$name

Returns

string

Throws

InvalidArgumentException
public static NGS\UUID
# v3( string|NGS\UUID $namespace, string $name )

Constructs new UUID instance by with generated version 3 UUID (MD5 hash)

Constructs new UUID instance by with generated version 3 UUID (MD5 hash)

Parameters

$namespace
string|NGS\UUID
uuid $namespace
$name
string
$name

Returns

NGS\UUID

Throws

InvalidArgumentException
public static NGS\UUID
# v4( )

Constructs new UUID instance with generated version 4 UUID (random)

Constructs new UUID instance with generated version 4 UUID (random)

Returns

NGS\UUID
public static NGS\UUID
# v5( string|NGS\UUID $namespace, string $name )

Constructs new UUID instance with generated version 5 UUID (SHA-1 hash)

Constructs new UUID instance with generated version 5 UUID (SHA-1 hash)

Parameters

$namespace
string|NGS\UUID
uuid $namespace
$name
string
$name

Returns

NGS\UUID

Throws

InvalidArgumentException
public string
# __toString( )

Gets UUID string value

Gets UUID string value

Returns

string
public static boolean
# isValid( string $uuid )

Validates UUID string

Validates UUID string

Parameters

$uuid
string
$uuid

Returns

boolean
API documentation generated by ApiGen 2.8.0