You are here

function biblio_migrate_api in Bibliography Module 7.3

Implements hook_migrate_api().

File

./biblio.module, line 930
Maintains bibliographic lists.

Code

function biblio_migrate_api() {
  $migrations = $groups = array();
  if (biblio_check_biblio_migration_needed()) {
    $group_name = 'biblio_3';
    $groups = array(
      $group_name => array(
        'title' => t('Biblio 3.x'),
      ),
    );
    $migrations = array(
      'BiblioMigrateContributorCollections' => array(
        'group_name' => $group_name,
        'class_name' => 'BiblioMigrateContributorCollections',
      ),
      'BiblioMigrateTypes' => array(
        'group_name' => $group_name,
        'class_name' => 'BiblioMigrateTypes',
      ),
    );

    // Handle per bundle migration.
    $entity_info = entity_get_info('biblio');
    foreach (array_keys($entity_info['bundles']) as $bundle_name) {
      $machine_name = 'BiblioMigrateEntries_' . $bundle_name;
      $migration = array();
      $migration['class_name'] = 'BiblioMigrateEntries';
      $migration['bundle_name'] = $bundle_name;
      $migration['group_name'] = $group_name;
      $migrations[$machine_name] = $migration;
    }
  }
  $api = array(
    'api' => 2,
    'groups' => $groups,
    'migrations' => $migrations,
  );
  return $api;
}