You are here

function pmticket_migrate_field_data in Drupal PM (Project Management) 7.2

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

Migrate pmticket node fields data to drupal user bundle.

1 call to pmticket_migrate_field_data()
pmticket_migrate in pmticket/includes/pmticket.migrate.inc
Helper function for migrating between pmticket to drupal fields.

File

pmticket/includes/pmticket.migrate.inc, line 70
Migration functions for the PM Ticket module.

Code

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