You are here

public function MigrationEventSubscriber::debugRowPreSave in Migrate Devel 8

Same name and namespace in other branches
  1. 8.2 src/EventSubscriber/MigrationEventSubscriber.php \Drupal\migrate_devel\EventSubscriber\MigrationEventSubscriber::debugRowPreSave()

Pre Row Save Function for --migrate-debug-pre.

Parameters

\Drupal\migrate\Event\MigratePreRowSaveEvent $event: Pre-Row-Save Migrate Event.

File

src/EventSubscriber/MigrationEventSubscriber.php, line 23

Class

MigrationEventSubscriber
MigrationEventSubscriber for Debugging Migrations.

Namespace

Drupal\migrate_devel\EventSubscriber

Code

public function debugRowPreSave(MigratePreRowSaveEvent $event) {
  $row = $event
    ->getRow();
  $using_drush = function_exists('drush_get_option');
  if ($using_drush && drush_get_option('migrate-debug-pre')) {

    // Start with capital letter for variables since this is actually a label.
    $Source = $row
      ->getSource();
    $Destination = $row
      ->getDestination();

    // We use kint directly here since we want to support variable naming.
    kint_require();
    \Kint::dump($Source, $Destination);
  }
}