You are here

function hook_validation_constraint_alter in Drupal 10

Same name and namespace in other branches
  1. 8 core/core.api.php \hook_validation_constraint_alter()
  2. 9 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 function implements hook_validation_constraint_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

ckeditor5_validation_constraint_alter in core/modules/ckeditor5/ckeditor5.module
Implements hook_validation_constraint_alter().
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 2283
Documentation landing page and topics, plus core library hooks.

Code

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