function hook_validation_constraint_alter

Same name in other branches
  1. 9 core/core.api.php \hook_validation_constraint_alter()
  2. 10 core/core.api.php \hook_validation_constraint_alter()
  3. 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\Annotation\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 2278

Code

function hook_validation_constraint_alter(array &$definitions) {
    $definitions['Null']['class'] = '\\Drupal\\mymodule\\Validator\\Constraints\\MyClass';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.