You are here

function entity_test_entity_test_mulrev_revision_create in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_entity_test_mulrev_revision_create()
  2. 9 core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_entity_test_mulrev_revision_create()

Implements hook_ENTITY_TYPE_revision_create() for 'entity_test_mulrev'.

File

core/modules/system/tests/modules/entity_test/entity_test.module, line 634
Test module for the entity API providing several entity types for testing.

Code

function entity_test_entity_test_mulrev_revision_create(EntityInterface $new_revision, EntityInterface $entity, $keep_untranslatable_fields) {
  if ($new_revision
    ->get('name')->value == 'revision_create_test_it') {
    $new_revision
      ->set('name', 'revision_create_test_it_altered');
  }
  _entity_test_record_hooks('entity_test_mulrev_revision_create', [
    'new_revision' => $new_revision,
    'entity' => $entity,
    'keep_untranslatable_fields' => $keep_untranslatable_fields,
  ]);
}