Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Uuid.php

function Uuid::uuid7

Returns a version 7 (Unix Epoch time) UUID

Parameters

DateTimeInterface|null $dateTime An optional date/time from which: to create the version 7 UUID. If not provided, the UUID is generated using the current date/time.

Return value

UuidInterface A UuidInterface instance that represents a version 7 UUID

File

vendor/ramsey/uuid/src/Uuid.php, line 715

Class

Uuid
Uuid provides constants and static methods for working with and generating UUIDs

Namespace

Ramsey\Uuid

Code

public static function uuid7(?DateTimeInterface $dateTime = null) : UuidInterface {
    $factory = self::getFactory();
    if (method_exists($factory, 'uuid7')) {
        
        /** @var UuidInterface */
        return $factory->uuid7($dateTime);
    }
    throw new UnsupportedOperationException('The provided factory does not support the uuid7() method');
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal