UuidConstraint.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UuidConstraint.php
  2. 8.9.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UuidConstraint.php
  3. 11.x core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UuidConstraint.php

Namespace

Drupal\Core\Validation\Plugin\Validation\Constraint

File

core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UuidConstraint.php

View source
<?php

namespace Drupal\Core\Validation\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Constraints\Uuid;
use Symfony\Component\Validator\Constraints\UuidValidator;

/**
 * Validates a UUID.
 */
class UuidConstraint extends Uuid {
    
    /**
     * {@inheritdoc}
     *
     * @return string
     *   The name of the class that validates this constraint.
     *
     * @todo Add method return type declaration.
     * @see https://www.drupal.org/project/drupal/issues/3425150
     */
    public function validatedBy() {
        return UuidValidator::class;
    }

}

Classes

Title Deprecated Summary
UuidConstraint Validates a UUID.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.