GdprSanitize.php in General Data Protection Regulation 8.2
File
modules/gdpr_dump/src/Service/GdprSanitize.php
View source
<?php
namespace Drupal\gdpr_dump\Service;
use function array_keys;
class GdprSanitize extends GdprSqlDump {
public function sanitize() {
$this
->prepare();
$this
->rename();
}
protected function rename() {
$transaction = $this->database
->startTransaction('gdpr_rename_table');
foreach (array_keys($this->tablesToAnonymize) as $table) {
$gdprTable = self::GDPR_TABLE_PREFIX . $table;
$this->database
->schema()
->dropTable($table);
$this->database
->schema()
->renameTable($gdprTable, $table);
}
$this->database
->popTransaction($transaction
->name());
}
}