You are here

function pmorganization_migrate_field_data in Drupal PM (Project Management) 7.2

Same name and namespace in other branches
  1. 8 pmorganization/includes/pmorganization.migrate.inc \pmorganization_migrate_field_data()
  2. 7.3 pmorganization/includes/pmorganization.migrate.inc \pmorganization_migrate_field_data()

Migrate pmorganization node fields data to drupal user bundle.

1 call to pmorganization_migrate_field_data()
pmorganization_migrate in pmorganization/includes/pmorganization.migrate.inc
Helper function for migrating between pmorganization to drupal fields.

File

pmorganization/includes/pmorganization.migrate.inc, line 70
Migration functions for the PM Organization module.

Code

function pmorganization_migrate_field_data(&$sandbox) {
  $results = db_select('pmorganization', 'pmorg')
    ->fields('pmorg')
    ->condition('vid', $sandbox['pmorganization_current_vid_of_field_being_migrated'], '>')
    ->range(0, PMORGANIZATION_MIGRATE_MAX_JOB_PER_BATCH)
    ->execute();
  $count = 0;
  foreach ($results as $pmorganization) {
    $count++;
    $sandbox['pmorganization_current_vid_of_field_being_migrated'] = $pmorganization->vid;
    try {
      _pmorganization_migrate_migrate_single_node($pmorganization->nid, $pmorganization->vid, $pmorganization);
    } catch (Exception $exc) {
      watchdog('pmorganization', 'See ' . __FUNCTION__ . '() ' . $exc
        ->getTraceAsString(), NULL, WATCHDOG_ERROR);
    }
  }
  return empty($count);
}