function hook_validation_constraint_alter
Same name in other branches
- 9 core/core.api.php \hook_validation_constraint_alter()
- 8.9.x core/core.api.php \hook_validation_constraint_alter()
- 11.x core/core.api.php \hook_validation_constraint_alter()
Alter validation constraint plugin definitions.
Parameters
array[] $definitions: The array of validation constraint definitions, keyed by plugin ID.
See also
\Drupal\Core\Validation\ConstraintManager
\Drupal\Core\Validation\Attribute\Constraint
Related topics
1 invocation of hook_validation_constraint_alter()
- ConstraintManager::__construct in core/
lib/ Drupal/ Core/ Validation/ ConstraintManager.php - Overrides \Drupal\Component\Plugin\PluginManagerBase::__construct().
File
-
core/
core.api.php, line 2302
Code
function hook_validation_constraint_alter(array &$definitions) {
$definitions['Null']['class'] = '\\Drupal\\my_module\\Plugin\\Validation\\Constraints\\MyClass';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.