You are here

function entity_test_update_view_presave in Drupal 9

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

Implements hook_ENTITY_TYPE_presave() for the 'view' entity type.

File

core/modules/system/tests/modules/entity_test_update/entity_test_update.module, line 57
Provides an entity type for testing definition and schema updates.

Code

function entity_test_update_view_presave(EntityInterface $entity) {
  if (\Drupal::state()
    ->get('entity_test_update.throw_view_exception') === $entity
    ->id()) {
    throw new \LogicException('The view could not be saved.');
  }
}