You are here

function replication_modules_installed in Replication 8

implements hook_modules_installed().

File

./replication.install, line 10

Code

function replication_modules_installed($modules) {
  if (in_array('replication', $modules)) {
    $entity_type_id = 'replication_log';
    $entity_types = \Drupal::service('multiversion.manager')
      ->getSupportedEntityTypes();
    $entity_type = \Drupal::entityTypeManager()
      ->getStorage($entity_type_id)
      ->getEntityType();
    if (in_array($entity_type_id, array_keys($entity_types))) {
      \Drupal::service('multiversion.manager')
        ->enableEntityTypes([
        $entity_type_id => $entity_type,
      ]);
    }
  }
}