class FieldListUniqueValues in Helper 8
Checks if a field has duplicate values.
Plugin annotation
@Constraint(
id = "UniqueFieldValues",
label = @Translation("Unique field values", context = "Validation"),
)
Hierarchy
- class \Drupal\helper\Plugin\Validation\Constraint\FieldListUniqueValues extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of FieldListUniqueValues
File
- src/
Plugin/ Validation/ Constraint/ FieldListUniqueValues.php, line 15
Namespace
Drupal\helper\Plugin\Validation\ConstraintView source
class FieldListUniqueValues extends Constraint {
/**
* Message if field contains duplicate values.
*
* @var string
*/
public $message = 'The field %field_name contains duplicate values.';
/**
* Message with values if field contains duplicate values.
*
* @var string
*/
public $messageWithValues = 'The field %field_name contains duplicate values: @values.';
/**
* The field property to use when searching for values.
*
* @var string
*/
public $property = NULL;
/**
* If the message should show the field values that are duplicates.
*
* @var bool
*/
public $show_values = TRUE;
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FieldListUniqueValues:: |
public | property | Message if field contains duplicate values. | |
FieldListUniqueValues:: |
public | property | Message with values if field contains duplicate values. | |
FieldListUniqueValues:: |
public | property | The field property to use when searching for values. | |
FieldListUniqueValues:: |
public | property | If the message should show the field values that are duplicates. |