class MachineNameUniqueConstraint in Machine name 8
Checks if an entity field has a unique value.
Plugin annotation
@Constraint(
id = "MachineNameUnique",
label = @Translation("Unique machine name constraint", context = "Validation"),
)
Hierarchy
- class \Drupal\machine_name\Plugin\Validation\Constraint\MachineNameUniqueConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of MachineNameUniqueConstraint
File
- src/
Plugin/ Validation/ Constraint/ MachineNameUniqueConstraint.php, line 15
Namespace
Drupal\machine_name\Plugin\Validation\ConstraintView source
class MachineNameUniqueConstraint extends Constraint {
public $message = 'The machine name %value is already in use. It must be unique.';
/**
* {@inheritdoc}
*/
public function validatedBy() {
return '\\Drupal\\machine_name\\Plugin\\Validation\\Constraint\\MachineNameUniqueValidator';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MachineNameUniqueConstraint:: |
public | property | ||
MachineNameUniqueConstraint:: |
public | function | Returns the name of the class that validates this constraint. |