xplo.re Medusa Core Framework 3.1
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Event
  • Todo
  • Download

Namespaces

  • Core
    • Authentication
      • Auto
        • Driver
      • Driver
    • Cache
      • Driver
    • Charset
      • Driver
    • Configuration
    • Controller
    • Converter
      • Driver
    • Decoder
      • Driver
    • Encoder
      • Driver
    • Env
      • Authentication
      • Locale
      • Proxy
      • Server
        • HTTP
        • Redirect
        • X
    • Exception
    • Exchange
      • Driver
    • Field
    • Filter
      • Driver
    • Formatter
      • Driver
        • coreuimarkup
          • Token
    • Hash
    • Loader
    • Locale
    • Log
      • Driver
    • Module
      • Dependency
        • Requirement
          • Core
          • PHP
      • Linkage
        • Driver
    • PDF
    • Plugin
    • Query
      • Driver
    • Server
      • Driver
    • Session
      • Driver
    • Set
    • Storage
      • Driver
      • Field
        • Element
    • Stream
      • Driver
    • String
    • Translation
      • Driver
      • Language
        • Driver
    • URI
      • Driver
    • Version
    • View
      • Driver
        • coreui
          • Control
            • Button
            • Table
          • Element
        • htmlbuilder
          • Tags
        • yui
          • Modules
  • None
  • PHP

Classes

  • Authentication
  • Authentication_Token
  • Autoloader
  • Cache
  • Charset
  • ClassDescriptor
  • Closure
  • Controller
  • Converter
  • Date
  • Decoder
  • Delegate
  • Dispatcher
  • Encoder
  • Env
  • Env_Field
  • Env_File
  • Env_FileList
  • Env_Request
  • Env_SERVER
  • Exchange
  • Fault
  • Field
  • Filter
  • Filter_Value
  • Formatter
  • Hash
  • IP
  • Loader
  • Locale
  • Locale_Iterator
  • Locale_Node
  • Log
  • Module
  • Module_Iterator
  • Nothing
  • Object
  • OS
  • Plugin
  • Profiler
  • Query
  • Registry
  • Resource
  • Server
  • Session
  • Session_Token
  • Set
  • Storage
  • Storage_Result
  • Storage_Statement
  • Stream
  • String
  • Translation
  • URI
  • URI_Parameters
  • UUID
  • Value
  • Version
  • View

Interfaces

  • Accessor
  • Chainable
  • Comparable
  • Configurable
  • Equality
  • Identity
  • Inquiry
  • Masquerade
  • Mutator
  • SeekableStream
  • Storable
  • Variator

Exceptions

  • Exception

Constants

  • Copyright
  • ProductName
  • UseVersion
  • Version

Functions

  • ns_expand
  • ns_file_exists
  • ns_get_version
  • ns_resolve

Class UUID

Universally unique identifier.

Core\Object implements Core\Chainable
Extended by Core\Set implements Core\Accessor
Extended by Core\UUID implements Core\Comparable, Core\Equality, Serializable, Core\Storable
Namespace: Core
Package: Core
Since: 3.0
Requires: PHP 5.3
Version: 1.1
Located at UUID.inc.php

Methods summary

public
# __construct( string $uuid = null )

Initialises new UUID instance with a random UUID or a given (binary) UUID string.

Initialises new UUID instance with a random UUID or a given (binary) UUID string.

Parameters

$uuid

UUID to initialise object with. Supports generic UUID strings, enclosed GUIDs and UUID hash values (16-byte binary string).

Throws

Core\Exception\InvalidArgument
Failed to parse invalid UUID.

See

UUID::hash()
UUID::gen()

Since

3.0
public static string
# gen( )

Returns a new random version 4 UUID string. Confer RFC 4122 for details.

Returns a new random version 4 UUID string. Confer RFC 4122 for details.

Returns

string
A new random version 4 UUID string.

Link

A Universally Unique IDentifier (UUID) URN Namespace

See

Core\UUID::genURN()

Since

3.0
public static string
# genID( )

Returns an identifier string from a temporary UUID.

Returns an identifier string from a temporary UUID.

Returns

string

Identifier string created from a temporary UUID. An identifier string is guaranteed to start with a letter and may only contain letters, digits and underscores.

See

Core\UUID::identifier()

Since

3.0
public static string
# genURN( )

Returns a new UUID URN from a random version 4 UUID.

Returns a new UUID URN from a random version 4 UUID.

Returns

string
A new UUID URN string.

See

Core\UUID::gen()
Core\UUID::urn()

Since

3.0
public static Core\UUID
# unpack( string $uuid )

Returns a new UUID created from a 16-byte (128-bit) binary UUID string.

Returns a new UUID created from a 16-byte (128-bit) binary UUID string.

Parameters

$uuid
16-byte binary UUID string to recover UUID from.

Returns

Core\UUID

Since

3.1

Implementation of

Core\Storable::unpack()
public string
# __toString( )

Formats UUID string.

Formats UUID string.

Returns

string
UUID string.

Since

3.0

Overrides

Core\Object::__toString
public boolean
# compareTo( Core\UUID|string $uuid )

Compares the current UUID with another UUID instance or UUID string.

Compares the current UUID with another UUID instance or UUID string.

Parameters

$uuid
UUID to compare current UUID with.

Returns

boolean

Returns < 0 if the current UUID is less than the given UUID; > 0 if the current UUID is greater than the given UUID, and 0 if both are equal.

Since

3.0

Implementation of

Core\Comparable::compareTo()
public string
# hash( )

Returns the hash code of the current UUID.

Returns the hash code of the current UUID.

The hash format changed in version 1.1 from a hexadecimal representation to a binary format. Use bin2hex() on the returned hash to retrieve a version 1.0 hash string. The returned value equals Core\UUID::pack().

Returns

string
UUID hash value.

See

Core\UUID::pack()

Since

3.0

Overrides

Core\Object::hash
public string
# identifier( )

Returns an identifier string created from the current UUID.

Returns an identifier string created from the current UUID.

Returns

string

Identifier string created from the current UUID. An identifier string is guaranteed to start with a letter and may only contain letters, digits and underscores.

Since

3.0
public boolean
# isEqualTo( Core\UUID|string $uuid )

Compares the current UUID with another UUID for equality.

Compares the current UUID with another UUID for equality.

Parameters

$uuid
UUID to compare current UUID with.

Returns

boolean
Returns true, if both UUIDs are equal, otherwise false.

See

Core\UUID::compareTo()

Since

3.0

Implementation of

Core\Equality::isEqualTo()
public string
# pack( )

Returns the 16-byte (128-bit) binary UUID string.

Returns the 16-byte (128-bit) binary UUID string.

Returns

string
Packed UUID binary.

Since

3.1

Implementation of

Core\Storable::pack()
public string
# serialize( )

Returns serialized UUID string.

Returns serialized UUID string.

Returns

string
Serialized UUID string.

Since

3.0

Implementation of

Serializable::serialize()
public
# unserialize( string $stream )

Resets UUID internals to serialized UUID string.

Resets UUID internals to serialized UUID string.

Parameters

$stream
Serialized data stream to reset UUID internals with.

Since

3.0

Implementation of

Serializable::unserialize()
public string
# urn( )

Returns UUID URN from current UUID.

Returns UUID URN from current UUID.

Returns

string
UUID URN from current UUID.

Since

3.0
protected string|boolean
# _parseUUID( string $uuid )

Parses the given UUID string, enclosed GUID or UUID hash and returns a lowercase UUID string on success, otherwise false.

Parses the given UUID string, enclosed GUID or UUID hash and returns a lowercase UUID string on success, otherwise false.

Parameters

$uuid
UUID string to parse.

Returns

string|boolean
UUID string on success, otherwise false.

Since

3.0

Methods inherited from Core\Set

__get(), __isset()

Methods inherited from Core\Object

__autocreateFactory(), __call(), __processParameters(), attachMethod(), chain(), getValueForKey(), getValueForKeyPath(), getValueForUndefinedKey(), issetValueForKey(), setValueForKey(), setValueForKeyPath(), setValueForUndefinedKey(), uuid()

Constants summary

string Zero

Non-unique zero UUID.

Non-unique zero UUID.

Since

3.0
# '00000000-0000-0000-0000-000000000000'

Constants inherited from Core\Object

AnyParameterType, AutochainParameterType, AutocreateParameterType, BooleanParameterType, CharParameterType, EnumParameterType, IntegerParameterType, RealParameterType, StringParameterType, UserParameterType

Properties summary

protected string $_v_uuid

UUID stored with class.

UUID stored with class.

Since

3.0
#

Magic properties

public read-only string $uuid

UUID string.

Magic properties inherited from Core\Object

$hash

xplo.re Medusa Core Framework 3.1 API documentation generated by ApiGen