You are here

function migrate_prepare_row_test_migrate_prepare_row in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/migrate/tests/modules/migrate_prepare_row_test/migrate_prepare_row_test.module \migrate_prepare_row_test_migrate_prepare_row()

Implements hook_migrate_prepare_row().

File

core/modules/migrate/tests/modules/migrate_prepare_row_test/migrate_prepare_row_test.module, line 17
Test module for testing the migration source plugin prepareRow() exception handling.

Code

function migrate_prepare_row_test_migrate_prepare_row(Row $row, MigrateSourceInterface $source, MigrationInterface $migration) {

  // Test both options for save_to_map.
  $data = $row
    ->getSourceProperty('data');
  if ($data == 'skip_and_record') {
    throw new MigrateSkipRowException('', TRUE);
  }
  elseif ($data == 'skip_and_dont_record') {
    throw new MigrateSkipRowException('', FALSE);
  }
}