You are here

function og_migrate_api in Organic groups 7.2

Implements hook_migrate_api().

File

./og.module, line 3727
Enable users to create and manage groups with roles and permissions.

Code

function og_migrate_api() {
  $migrations = array();
  if (db_table_exists('d6_og')) {
    $migrations['OgMigrateAddFields'] = array(
      'class_name' => 'OgMigrateAddFields',
    );
    $migrations['OgMigrateContent'] = array(
      'class_name' => 'OgMigrateContent',
    );
    $migrations['OgMigrateUser'] = array(
      'class_name' => 'OgMigrateUser',
    );
    foreach (node_type_get_names() as $bundle => $value) {
      $machine_name = 'OgMigrateGroup' . ucfirst($bundle);
      $migrations[$machine_name] = array(
        'class_name' => 'OgMigrateGroup',
        'bundle' => $bundle,
      );
    }
    if (db_table_exists('d6_og_users_roles')) {

      // OG user roles (OGUR) related migrations.
      $migrations['OgMigrateOgurRoles'] = array(
        'class_name' => 'OgMigrateOgurRoles',
      );
      $migrations['OgMigrateOgur'] = array(
        'class_name' => 'OgMigrateOgur',
      );
    }
  }
  elseif (db_field_exists('og_membership', 'group_type') && db_table_exists('og') && !db_table_exists('d6_og')) {
    $migrations['OgMigrateMembership'] = array(
      'class_name' => 'OgMigrateMembership',
    );
    $migrations['OgMigrateRoles'] = array(
      'class_name' => 'OgMigrateRoles',
    );
    $migrations['OgMigrateUserRoles'] = array(
      'class_name' => 'OgMigrateUserRoles',
    );
  }
  $api = array(
    'api' => 2,
    'migrations' => $migrations,
  );
  return $api;
}