function UuidFactory::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/ UuidFactory.php, line 403
Class
Namespace
Ramsey\UuidCode
public function uuid7(?DateTimeInterface $dateTime = null) : UuidInterface {
assert($this->unixTimeGenerator instanceof UnixTimeGenerator);
$bytes = $this->unixTimeGenerator
->generate(null, null, $dateTime);
return $this->uuidFromBytesAndVersion($bytes, Uuid::UUID_TYPE_UNIX_TIME);
}