You are here

function pmnote_migrate_field_data in Drupal PM (Project Management) 7.3

Same name and namespace in other branches
  1. 8 pmnote/includes/pmnote.migrate.inc \pmnote_migrate_field_data()
  2. 7.2 pmnote/includes/pmnote.migrate.inc \pmnote_migrate_field_data()

Migrate pmnote node fields data to drupal user bundle.

1 call to pmnote_migrate_field_data()
pmnote_migrate in pmnote/includes/pmnote.migrate.inc
Helper function for migrating between pmnote to drupal fields.

File

pmnote/includes/pmnote.migrate.inc, line 69
Migration functions for the PM Note module.

Code

function pmnote_migrate_field_data(&$sandbox) {
  $results = db_select('pmnote', 'pmn')
    ->fields('pmn')
    ->condition('vid', $sandbox['pmnote_current_vid_of_field_being_migrated'], '>')
    ->range(0, PMNOTE_MIGRATE_MAX_JOB_PER_BATCH)
    ->execute();
  $count = 0;
  foreach ($results as $pmnote) {
    $count++;
    $sandbox['pmnote_current_vid_of_field_being_migrated'] = $pmnote->vid;
    try {
      _pmnote_migrate_migrate_single_node($pmnote->nid, $pmnote->vid, $pmnote);
    } catch (Exception $exc) {
      watchdog('pmnote', 'See ' . __FUNCTION__ . '() ' . $exc
        ->getTraceAsString(), NULL, WATCHDOG_ERROR);
    }
  }
  return empty($count);
}