class FileUriUnique

Same name in other branches
  1. 9 core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php \Drupal\file\Plugin\Validation\Constraint\FileUriUnique
  2. 8.9.x core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php \Drupal\file\Plugin\Validation\Constraint\FileUriUnique
  3. 11.x core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php \Drupal\file\Plugin\Validation\Constraint\FileUriUnique

Supports validating file URIs.

Hierarchy

  • class \Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldConstraint extends \Symfony\Component\Validator\Constraint
    • class \Drupal\file\Plugin\Validation\Constraint\FileUriUnique extends \Drupal\Core\Validation\Plugin\Validation\Constraint\UniqueFieldConstraint

Expanded class hierarchy of FileUriUnique

1 string reference to 'FileUriUnique'
File::baseFieldDefinitions in core/modules/file/src/Entity/File.php

File

core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php, line 13

Namespace

Drupal\file\Plugin\Validation\Constraint
View source
class FileUriUnique extends UniqueFieldConstraint {
    public $message = 'The file %value already exists. Enter a unique file URI.';
    
    /**
     * This constraint is case-sensitive.
     *
     * For example "public://foo.txt" and "public://FOO.txt" are treated as
     * different values, and can co-exist.
     *
     * @var bool
     */
    public $caseSensitive = TRUE;
    
    /**
     * {@inheritdoc}
     */
    public function validatedBy() : string {
        return UniqueFieldValueValidator::class;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
FileUriUnique::$caseSensitive public property This constraint is case-sensitive. Overrides UniqueFieldConstraint::$caseSensitive
FileUriUnique::$message public property Overrides UniqueFieldConstraint::$message
FileUriUnique::validatedBy public function Returns the name of the class that validates this constraint. Overrides UniqueFieldConstraint::validatedBy

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