3 namespace Drupal\migrate_prepare_row_test\Plugin\migrate\process;
5 use Drupal\migrate\MigrateExecutableInterface;
6 use Drupal\migrate\MigrateSkipRowException;
7 use Drupal\migrate\ProcessPluginBase;
8 use Drupal\migrate\Row;
11 * Provides a testing process plugin that skips rows.
13 * @MigrateProcessPlugin(
14 * id = "test_skip_row_process"
17 class TestSkipRowProcess extends ProcessPluginBase {
22 public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
23 // Test both options for save_to_map.
24 $data = $row->getSourceProperty('data');
25 if ($data == 'skip_and_record (use plugin)') {
26 throw new MigrateSkipRowException('', TRUE);
28 elseif ($data == 'skip_and_dont_record (use plugin)') {
29 throw new MigrateSkipRowException('', FALSE);