You are here

public function MigrateDestinationVotingapi::prepare in Migrate Extras 7.2

Same name and namespace in other branches
  1. 6.2 votingapi.inc \MigrateDestinationVotingapi::prepare()

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

Parameters

$entity: Entity 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 MigrateDestinationVotingapi::prepare()
MigrateDestinationVotingapi::import in ./votingapi.inc
Import a single vote.

File

./votingapi.inc, line 139
VotingAPI module integration

Class

MigrateDestinationVotingapi
Destination class for the votingapi_vote table.

Code

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

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