public function MigrateSQLMap::deleteDestination in Migrate 7.2
Same name and namespace in other branches
- 6.2 plugins/sources/sqlmap.inc \MigrateSQLMap::deleteDestination()
Delete the map entry and any message table entries for the specified destination row.
Parameters
array $destination_key:
Overrides MigrateMap::deleteDestination
File
- plugins/
sources/ sqlmap.inc, line 604 - Defines a Drupal db-based implementation of MigrateMap.
Class
- MigrateSQLMap
- @file Defines a Drupal db-based implementation of MigrateMap.
Code
public function deleteDestination(array $destination_key) {
$map_query = $this->connection
->delete($this->mapTable);
$message_query = $this->connection
->delete($this->messageTable);
$source_key = $this
->lookupSourceID($destination_key);
if (!empty($source_key)) {
$count = 1;
foreach ($destination_key as $key_value) {
$map_query
->condition('destid' . $count, $key_value);
$count++;
}
$map_query
->execute();
$count = 1;
foreach ($source_key as $key_value) {
$message_query
->condition('sourceid' . $count, $key_value);
$count++;
}
$message_query
->execute();
}
}