You are here

function entity_test_constraints_entity_type_build in Drupal 8

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_build()
  2. 10 core/modules/system/tests/modules/entity_test_constraints/entity_test_constraints.module \entity_test_constraints_entity_type_build()

Implements hook_entity_type_build().

File

core/modules/system/tests/modules/entity_test_constraints/entity_test_constraints.module, line 11
Test module file.

Code

function entity_test_constraints_entity_type_build(array &$entity_types) {
  if ($extra = \Drupal::state()
    ->get('entity_test_constraints.build')) {
    foreach ($extra as $id => $option) {
      $entity_types['entity_test_constraints']
        ->addConstraint($id, $option);
    }
  }
}