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

Breadcrumb

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

function Ulid::__construct

Parameters

array<string,mixed>|null $options:

string[]|null $groups:

self::FORMAT_*|null $format:

Overrides Constraint::__construct

File

vendor/symfony/validator/Constraints/Ulid.php, line 53

Class

Ulid
Validates that a value is a valid Universally Unique Lexicographically Sortable Identifier (ULID).

Namespace

Symfony\Component\Validator\Constraints

Code

public function __construct(?array $options = null, ?string $message = null, ?array $groups = null, mixed $payload = null, ?string $format = null) {
    parent::__construct($options, $groups, $payload);
    $this->message = $message ?? $this->message;
    $this->format = $format ?? $this->format;
    if (!\in_array($this->format, [
        self::FORMAT_BASE_32,
        self::FORMAT_BASE_58,
        self::FORMAT_RFC_4122,
    ], true)) {
        throw new ConstraintDefinitionException(\sprintf('The "%s" validation format is not supported.', $format));
    }
}

API Navigation

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