function EntityTestConstraintsHooks::entityTypeAlter

Implements hook_entity_type_alter().

File

core/modules/system/tests/modules/entity_test_constraints/src/Hook/EntityTestConstraintsHooks.php, line 29

Class

EntityTestConstraintsHooks
Hook implementations for entity_test_constraints.

Namespace

Drupal\entity_test_constraints\Hook

Code

public function entityTypeAlter(array &$entity_types) : void {
    if ($alter = \Drupal::state()->get('entity_test_constraints.alter')) {
        $entity_types['entity_test_constraints']->setConstraints($alter);
    }
}

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