You are here

public function MigrateDestinationVotingapi::bulkRollback in Migrate Extras 7.2

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

Delete the provided votes and recalculate the results.

Parameters

$id: IDs to be deleted.

File

./votingapi.inc, line 37
VotingAPI module integration

Class

MigrateDestinationVotingapi
Destination class for the votingapi_vote table.

Code

public function bulkRollback(array $ids) {
  migrate_instrument_start(__METHOD__);
  foreach ($ids as $id) {
    $votes[]['vote_id'] = $id;
  }
  votingapi_delete_votes($votes);

  // foreach($votes as $vote) {
  //       votingapi_recalculate_results($vote['content_type'], $vote['content_id'], TRUE);
  //     }
  migrate_instrument_stop(__METHOD__);
}