You are here

function pmtask_migrate_field_data in Drupal PM (Project Management) 7.2

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

Migrate pmtask node fields data to drupal user bundle.

1 call to pmtask_migrate_field_data()
pmtask_migrate in pmtask/includes/pmtask.migrate.inc
Helper function for migrating between pmtask to drupal fields.

File

pmtask/includes/pmtask.migrate.inc, line 69
Migration functions for the PM Task module.

Code

function pmtask_migrate_field_data(&$sandbox) {
  $results = db_select('pmtask', 'pmt')
    ->fields('pmt')
    ->condition('vid', $sandbox['pmtask_current_vid_of_field_being_migrated'], '>')
    ->range(0, PMTASK_MIGRATE_MAX_JOB_PER_BATCH)
    ->execute();
  $count = 0;
  foreach ($results as $pmtask) {
    $count++;
    $sandbox['pmtask_current_vid_of_field_being_migrated'] = $pmtask->vid;
    try {
      _pmtask_migrate_migrate_single_node($pmtask->nid, $pmtask->vid, $pmtask);
    } catch (Exception $exc) {
      watchdog('pmtask', 'See ' . __FUNCTION__ . '() ' . $exc
        ->getTraceAsString(), NULL, WATCHDOG_ERROR);
    }
  }
  return empty($count);
}