class UniqueFieldConstraint in Unique field 8
Checks whether the field has unique values.
Plugin annotation
@Plugin(
id = "UniqueField",
label = @Translation("Unique field", context = "Validation"),
)
Hierarchy
- class \Drupal\unique_field\Plugin\Validation\Constraint\UniqueFieldConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of UniqueFieldConstraint
File
- src/
Plugin/ Validation/ Constraint/ UniqueFieldConstraint.php, line 22 - Contains \Drupal\unique_field\Plugin\Validation\Constraint\UniqueFieldConstraint.
Namespace
Drupal\unique_field\Plugin\Validation\ConstraintView source
class UniqueFieldConstraint extends Constraint {
public $bundle;
public $scope;
public $match;
public $comb;
public $fields;
public $matches = 'Matches are found in the following content: !node';
public $UniqueMessage = 'Field %label should be unique. %value is already used';
public function __construct($options = null) {
parent::__construct($options);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
UniqueFieldConstraint:: |
public | property | ||
UniqueFieldConstraint:: |
public | property | ||
UniqueFieldConstraint:: |
public | property | ||
UniqueFieldConstraint:: |
public | property | ||
UniqueFieldConstraint:: |
public | property | ||
UniqueFieldConstraint:: |
public | property | ||
UniqueFieldConstraint:: |
public | property | ||
UniqueFieldConstraint:: |
public | function | Initializes the constraint with options. |