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

Breadcrumb

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

function UuidInterface::compareTo

Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than the other UUID

The first of two UUIDs is greater than the second if the most significant field in which the UUIDs differ is greater for the first UUID.

  • Q. What's the value of being able to sort UUIDs?
  • A. Use them as keys in a B-Tree or similar mapping.

Parameters

UuidInterface $other The UUID to compare:

Return value

int<-1,1> -1, 0, or 1 if the UUID is less than, equal to, or greater than $other

2 methods override UuidInterface::compareTo()
LazyUuidFromString::compareTo in vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php
Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than the other UUID
Uuid::compareTo in vendor/ramsey/uuid/src/Uuid.php
Returns -1, 0, or 1 if the UUID is less than, equal to, or greater than the other UUID

File

vendor/ramsey/uuid/src/UuidInterface.php, line 51

Class

UuidInterface
A UUID is a universally unique identifier adhering to an agreed-upon representation format and standard for generation

Namespace

Ramsey\Uuid

Code

public function compareTo(UuidInterface $other) : int;

API Navigation

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