You are here

function entity_schema_test_entity_type_alter in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module \entity_schema_test_entity_type_alter()

Implements hook_entity_type_alter().

File

core/modules/system/tests/modules/entity_schema_test/entity_schema_test.module, line 16
Test module for the entity API providing a bundle field.

Code

function entity_schema_test_entity_type_alter(array &$entity_types) {
  if (\Drupal::state()
    ->get('entity_schema_update')) {
    $entity_type = $entity_types['entity_test'];
    $entity_type
      ->set('translatable', TRUE);
    $entity_type
      ->set('data_table', 'entity_test_field_data');
    $keys = $entity_type
      ->getKeys();
    $keys['revision'] = 'revision_id';
    $entity_type
      ->set('entity_keys', $keys);
  }
}