You are here

public function MigrateDestinationWebformSubmission::prepare in Migrate Extras 7.2

Give handlers a shot at modifying the object before saving it.

Parameters

$entity: Webform submission object to build. Prefilled with any fields mapped in the Migration.

$source_row: Raw source data object - passed through to prepare handlers.

1 call to MigrateDestinationWebformSubmission::prepare()
MigrateDestinationWebformSubmission::import in ./webform.inc
Import a record.

File

./webform.inc, line 126

Class

MigrateDestinationWebformSubmission
Destination class for the webform_submissions table.

Code

public function prepare($entity, stdClass $source_row) {
  $migration = Migration::currentMigration();
  $entity->migrate = array(
    'machineName' => $migration
      ->getMachineName(),
  );

  // Call any general object handlers.
  migrate_handler_invoke_all('WebformSubmission', 'prepare', $entity, $source_row, $this->node);

  // Then call any prepare handler for this specific Migration.
  if (method_exists($migration, 'prepare')) {
    $migration
      ->prepare($entity, $source_row, $this->node);
  }
}