You are here

function hook_validation_constraint_alter in Drupal 8

Same name and namespace in other branches
  1. 9 core/core.api.php \hook_validation_constraint_alter()
  2. 10 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
Documentation landing page and topics, plus core library hooks.

Code

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