class RegExValidationConstraint in RegEx Field Validation 1.0.x
Same name and namespace in other branches
- 8 src/Plugin/Validation/Constraint/RegExValidationConstraint.php \Drupal\regex_field_validation\Plugin\Validation\Constraint\RegExValidationConstraint
- 2.0.x src/Plugin/Validation/Constraint/RegExValidationConstraint.php \Drupal\regex_field_validation\Plugin\Validation\Constraint\RegExValidationConstraint
Checks that the node.
Plugin annotation
@Constraint(
id = "RegExValidationConstraint",
label = @Translation("RegEx Validation"),
)
Hierarchy
- class \Drupal\regex_field_validation\Plugin\Validation\Constraint\RegExValidationConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of RegExValidationConstraint
1 string reference to 'RegExValidationConstraint'
File
- src/
Plugin/ Validation/ Constraint/ RegExValidationConstraint.php, line 15
Namespace
Drupal\regex_field_validation\Plugin\Validation\ConstraintView source
class RegExValidationConstraint extends Constraint {
public $regex;
public $errorMessage;
/**
* Class constructor.
*/
public function __construct($options = NULL) {
if (!empty($options) && is_array($options)) {
$options = [
'regex' => $options['regex'],
'errorMessage' => $options['errorMessage'],
];
parent::__construct($options);
}
else {
drupal_set_message('There was an issue with the RegExValidation module initialisation', 'error');
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RegExValidationConstraint:: |
public | property | ||
RegExValidationConstraint:: |
public | property | ||
RegExValidationConstraint:: |
public | function | Class constructor. |