UuidConstraint.php

Same filename in other branches
  1. 9 core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/UuidConstraint.php
  2. 10 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 Symfony\Component\Validator\Constraints\Uuid;
use Symfony\Component\Validator\Constraints\UuidValidator;

/**
 * Validates a UUID.
 *
 * @Constraint(
 *   id = "Uuid",
 *   label = @Translation("Universally Unique Identifier", context = "Validation"),
 * )
 */
class UuidConstraint extends Uuid {
    
    /**
     * {@inheritdoc}
     */
    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.