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

Breadcrumb

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

trait NilTrait

Provides common functionality for nil UUIDs

The nil UUID is special form of UUID that is specified to have all 128 bits set to zero.

@link https://tools.ietf.org/html/rfc4122#section-4.1.7 RFC 4122, ยง 4.1.7: Nil UUID

@psalm-immutable

Hierarchy

  • trait \Ramsey\Uuid\Rfc4122\NilTrait
1 file declares its use of NilTrait
Fields.php in vendor/ramsey/uuid/src/Guid/Fields.php

File

vendor/ramsey/uuid/src/Rfc4122/NilTrait.php, line 27

Namespace

Ramsey\Uuid\Rfc4122
View source
trait NilTrait {
    
    /**
     * Returns the bytes that comprise the fields
     */
    public abstract function getBytes() : string;
    
    /**
     * Returns true if the byte string represents a nil UUID
     */
    public function isNil() : bool {
        return $this->getBytes() === "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
    }

}

Members

Title Sort descending Modifiers Object type Summary
NilTrait::getBytes abstract public function Returns the bytes that comprise the fields
NilTrait::isNil public function Returns true if the byte string represents a nil UUID

API Navigation

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