You are here

function contact_storage_test_install in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.install \contact_storage_test_install()

Implements hook_install().

File

core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.install, line 11
Contains install and update hooks.

Code

function contact_storage_test_install() {
  $entity_manager = \Drupal::entityManager();
  $entity_type = $entity_manager
    ->getDefinition('contact_message');

  // Recreate the original entity type definition, in order to notify the
  // manager of what changed. The change of storage backend will trigger
  // schema installation.
  // @see contact_storage_test_entity_type_alter()
  $original = clone $entity_type;
  $original
    ->setStorageClass('Drupal\\Core\\Entity\\ContentEntityNullStorage');
  $entity_manager
    ->onEntityTypeUpdate($entity_type, $original);
}