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

Breadcrumb

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

class Uuid

Same name in this branch
  1. 11.1.x vendor/ramsey/uuid/src/Nonstandard/Uuid.php \Ramsey\Uuid\Nonstandard\Uuid
  2. 11.1.x vendor/ramsey/uuid/src/Uuid.php \Ramsey\Uuid\Uuid
  3. 11.1.x vendor/symfony/validator/Constraints/Uuid.php \Symfony\Component\Validator\Constraints\Uuid

UUID Helper methods.

Hierarchy

  • class \Drupal\Component\Uuid\Uuid

Expanded class hierarchy of Uuid

2 files declare their use of Uuid
CKEditor5MediaController.php in core/modules/ckeditor5/src/Controller/CKEditor5MediaController.php
JsonApiDocumentTopLevelNormalizer.php in core/modules/jsonapi/src/Normalizer/JsonApiDocumentTopLevelNormalizer.php
55 string references to 'Uuid'
BaseFieldOverrideStorage::createInstance in core/lib/Drupal/Core/Field/BaseFieldOverrideStorage.php
Instantiates a new instance of this entity handler.
CKEditor5MediaController::access in core/modules/ckeditor5/src/Controller/CKEditor5MediaController.php
Additional access check for ::isMediaImage().
CKEditor5MediaController::mediaEntityMetadata in core/modules/ckeditor5/src/Controller/CKEditor5MediaController.php
Returns JSON response containing metadata about media entity.
CommentAccessControlHandler::checkFieldAccess in core/modules/comment/src/CommentAccessControlHandler.php
Default field access as determined by this access control handler.
CommentTokensHooks::tokenInfo in core/modules/comment/src/Hook/CommentTokensHooks.php
Implements hook_token_info().

... See full list

File

core/lib/Drupal/Component/Uuid/Uuid.php, line 8

Namespace

Drupal\Component\Uuid
View source
class Uuid {
    
    /**
     * The pattern used to validate a UUID string.
     */
    const VALID_PATTERN = '[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}';
    
    /**
     * Checks that a string appears to be in the format of a lower-case UUID.
     *
     * Implementations should not implement validation, since UUIDs should be in
     * a consistent format across all implementations.
     *
     * @param string $uuid
     *   The string to test.
     *
     * @return bool
     *   TRUE if the string is well formed, FALSE otherwise.
     */
    public static function isValid($uuid) {
        return (bool) preg_match('/^' . self::VALID_PATTERN . '$/', $uuid);
    }

}

Members

Title Sort descending Modifiers Object type Summary
Uuid::isValid public static function Checks that a string appears to be in the format of a lower-case UUID.
Uuid::VALID_PATTERN constant The pattern used to validate a UUID string.
RSS feed
Powered by Drupal