You are here

protected function MySQLiSource::_lockTables in Backup and Migrate 8.4

Lock the list of given tables in the database.

File

lib/backup_migrate_core/src/Source/MySQLiSource.php, line 286

Class

MySQLiSource
Class MySQLiSource.

Namespace

BackupMigrate\Core\Source

Code

protected function _lockTables($tables) {
  if ($tables) {
    $tables_escaped = [];
    foreach ($tables as $table) {
      $tables_escaped[] = '`' . $table . '`  WRITE';
    }
    $this
      ->query('LOCK TABLES ' . implode(', ', $tables_escaped));
  }
}