You are here

protected function GdprDumpGdprSqlDump::cleanup in General Data Protection Regulation 7

Cleanup the database after the dump.

2 calls to GdprDumpGdprSqlDump::cleanup()
GdprDumpGdprSqlDump::dump in modules/gdpr_dump/inc/GdprDumpGdprSqlDump.inc
Dump command.
GdprDumpGdprSqlDump::prepare in modules/gdpr_dump/inc/GdprDumpGdprSqlDump.inc
Prepare the database for the dump.

File

modules/gdpr_dump/inc/GdprDumpGdprSqlDump.inc, line 296

Class

GdprDumpGdprSqlDump
Class GdprDumpGdprSqlDump.

Code

protected function cleanup() {
  $transaction = db_transaction('gdpr_drop_table');
  try {
    foreach (\array_keys($this->gdprOptions) as $table) {
      $gdprTable = self::GDPR_TABLE_PREFIX . $table;
      db_drop_table($gdprTable);
    }
  } catch (Exception $e) {
    $transaction
      ->rollback();
    drush_set_error('DRUSH_SQL_DUMP_FAIL', 'Database Cleanup failed');
  }
}