You are here

public function MigrateDestinationTable::rollback in Migrate 6.2

Same name and namespace in other branches
  1. 7.2 plugins/destinations/table.inc \MigrateDestinationTable::rollback()

Delete a single row.

Parameters

$id: Primary key values.

File

plugins/destinations/table.inc, line 64
Support for tables defined through the Schema API.

Class

MigrateDestinationTable
Destination class implementing migration into a single table defined through the Schema API.

Code

public function rollback(array $id) {
  migrate_instrument_start('table rollback');
  $delete = db_delete($this->tableName);
  $keys = array_keys(self::getKeySchema($this->tableName));
  $i = 0;
  foreach ($id as $value) {
    $key = $keys[$i++];
    $delete
      ->condition($key, $value);
  }
  $delete
    ->execute();
  migrate_instrument_stop('table rollback');
}