/** * React to a new row. * * @param \Drupal\migrate_plus\Event\MigratePrepareRowEvent $event * The prepare-row event. * * @throws \Drupal\migrate\MigrateSkipRowException * */ public function onPrepareRow(MigratePrepareRowEvent $event) { if ($this->idlist) { $row = $event->getRow(); $source_id = $row->getSourceIdValues(); if (!in_array(reset($source_id), $this->idlist)) { throw new MigrateSkipRowException(NULL, FALSE); } } if ($this->feedback && $this->counter && $this->counter % $this->feedback == 0) { $this->progressMessage(FALSE); $this->resetCounters(); } $this->counter++; if ($this->itemLimit && $this->counter >= $this->itemLimit) { $event->getMigration()->interruptMigration(MigrationInterface::RESULT_COMPLETED); } }
/** * React to a new row. * * @param \Drupal\migrate_plus\Event\MigratePrepareRowEvent $event * The prepare-row event. */ public function onPrepareRow(MigratePrepareRowEvent $event) { if ($this->idlist) { $row = $event->getRow(); $source_id = $row->getSourceIdValues(); if (!in_array(reset($source_id), $this->idlist)) { throw new MigrateSkipRowException(NULL, FALSE); } } }
/** * React to a new row. * * @param \Drupal\migrate_plus\Event\MigratePrepareRowEvent $event * The prepare-row event. */ public function onPrepareRow(MigratePrepareRowEvent $event) { $row = $event->getRow(); $row->setSourceProperty('first_last', $row->getSourceProperty('first_name') . ' ' . $row->getSourceProperty('last_name')); }