contact_storage_test.install 660 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * @file
  4. * Contains install and update hooks.
  5. */
  6. /**
  7. * Implements hook_install().
  8. */
  9. function contact_storage_test_install() {
  10. $entity_manager = \Drupal::entityManager();
  11. $entity_type = $entity_manager->getDefinition('contact_message');
  12. // Recreate the original entity type definition, in order to notify the
  13. // manager of what changed. The change of storage backend will trigger
  14. // schema installation.
  15. // @see contact_storage_test_entity_type_alter()
  16. $original = clone $entity_type;
  17. $original->setStorageClass('Drupal\Core\Entity\ContentEntityNullStorage');
  18. $entity_manager->onEntityTypeUpdate($entity_type, $original);
  19. }