You are here

public function MigrateDestinationVotingApiVote::complete in Voting API 7.2

Same name and namespace in other branches
  1. 7.3 votingapi.migrate.inc \MigrateDestinationVotingApiVote::complete()
1 call to MigrateDestinationVotingApiVote::complete()
MigrateDestinationVotingApiVote::import in ./votingapi.migrate.inc
Derived classes must implement import(), to construct one new object (pre-pppulated using field mappings in the Migration). It is expected to call prepare and complete handlers, passing them $row (the raw data from the source).

File

./votingapi.migrate.inc, line 166
Migration support for voting api.

Class

MigrateDestinationVotingApiVote
@file Migration support for voting api.

Code

public function complete($entity, stdClass $source_row) {

  // Call any complete handler for this specific Migration.
  $migration = Migration::currentMigration();
  if (method_exists($migration, 'complete')) {
    try {
      $migration
        ->complete($entity, $source_row);
    } catch (Exception $e) {

      // If we catch any errors here, save the messages without letting
      // the exception prevent the saving of the question.
      $migration
        ->saveMessage($e
        ->getMessage());
    }
  }
}