function entity_test_constraints_entity_type_alter

Same name and namespace in other branches
  1. 9 core/modules/system/tests/modules/entity_test_constraints/entity_test_constraints.module \entity_test_constraints_entity_type_alter()
  2. 8.9.x core/modules/system/tests/modules/entity_test_constraints/entity_test_constraints.module \entity_test_constraints_entity_type_alter()
  3. 11.x core/modules/system/tests/modules/entity_test_constraints/entity_test_constraints.module \entity_test_constraints_entity_type_alter()

Implements hook_entity_type_alter().

File

core/modules/system/tests/modules/entity_test_constraints/entity_test_constraints.module, line 22

Code

function entity_test_constraints_entity_type_alter(array &$entity_types) {
    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.