FileUriUnique.php

Same filename in other branches
  1. 8.9.x core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php
  2. 10 core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php
  3. 11.x core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php

Namespace

Drupal\file\Plugin\Validation\Constraint

File

core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php

View source
<?php

namespace Drupal\file\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraint;

/**
 * Supports validating file URIs.
 *
 * @Constraint(
 *   id = "FileUriUnique",
 *   label = @Translation("File URI", context = "Validation")
 * )
 */
class FileUriUnique extends Constraint {
    public $message = 'The file %value already exists. Enter a unique file URI.';
    
    /**
     * {@inheritdoc}
     */
    public function validatedBy() {
        return '\\Drupal\\Core\\Validation\\Plugin\\Validation\\Constraint\\UniqueFieldValueValidator';
    }

}

Classes

Title Deprecated Summary
FileUriUnique Supports validating file URIs.

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