You are here

public function Table::rollback in Migrate Plus 8.4

Same name and namespace in other branches
  1. 8.5 src/Plugin/migrate/destination/Table.php \Drupal\migrate_plus\Plugin\migrate\destination\Table::rollback()
  2. 8.3 src/Plugin/migrate/destination/Table.php \Drupal\migrate_plus\Plugin\migrate\destination\Table::rollback()

Delete the specified destination object from the target Drupal.

Parameters

array $destination_identifier: The ID of the destination object to delete.

Overrides DestinationBase::rollback

File

src/Plugin/migrate/destination/Table.php, line 182

Class

Table
Provides table destination plugin.

Namespace

Drupal\migrate_plus\Plugin\migrate\destination

Code

public function rollback(array $destination_identifier) {
  $delete = $this->dbConnection
    ->delete($this->tableName);
  foreach ($destination_identifier as $field => $value) {
    $delete
      ->condition($field, $value);
  }
  $delete
    ->execute();
}