You are here

class FileUriUnique in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php \Drupal\file\Plugin\Validation\Constraint\FileUriUnique
  2. 10 core/modules/file/src/Plugin/Validation/Constraint/FileUriUnique.php \Drupal\file\Plugin\Validation\Constraint\FileUriUnique

Supports validating file URIs.

Plugin annotation


@Constraint(
  id = "FileUriUnique",
  label = @Translation("File URI", context = "Validation")
)

Hierarchy

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

Expanded class hierarchy of FileUriUnique

1 string reference to 'FileUriUnique'
File::baseFieldDefinitions in core/modules/file/src/Entity/File.php
Provides base field definitions for an entity type.

File

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

Namespace

Drupal\file\Plugin\Validation\Constraint
View source
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';
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FileUriUnique::$message public property
FileUriUnique::validatedBy public function Returns the name of the class that validates this constraint.