You are here

public function backup_migrate_source_db_mysql::_lock_tables in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.3 includes/sources.db.mysql.inc \backup_migrate_source_db_mysql::_lock_tables()
  2. 6.3 includes/sources.db.mysql.inc \backup_migrate_source_db_mysql::_lock_tables()

Lock the list of given tables in the database.

Overrides backup_migrate_source_db::_lock_tables

File

includes/sources.db.mysql.inc, line 309
Functions to handle the direct to database source.

Class

backup_migrate_source_db_mysql
A source type for backing up from database server.

Code

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