You are here

public function MigrationEventSubscriber::debugRowPostSave in Migrate Devel 8

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

Post Row Save Function for --migrate-debug.

Parameters

\Drupal\migrate\Event\MigratePostRowSaveEvent $event: Post-Row-Save Migrate Event.

File

src/EventSubscriber/MigrationEventSubscriber.php, line 44

Class

MigrationEventSubscriber
MigrationEventSubscriber for Debugging Migrations.

Namespace

Drupal\migrate_devel\EventSubscriber

Code

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

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

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