You are here

public function backup_migrate_destination_db_mysql::_lock_tables in Backup and Migrate 7.3

Same name and namespace in other branches
  1. 8.2 includes/destinations.db.mysql.inc \backup_migrate_destination_db_mysql::_lock_tables()
  2. 8.3 includes/destinations.db.mysql.inc \backup_migrate_destination_db_mysql::_lock_tables()
  3. 6.2 includes/destinations.db.mysql.inc \backup_migrate_destination_db_mysql::_lock_tables()
  4. 7.2 includes/destinations.db.mysql.inc \backup_migrate_destination_db_mysql::_lock_tables()

Lock the list of given tables in the database.

Overrides backup_migrate_destination_db::_lock_tables

File

includes/destinations.db.mysql.inc, line 319
Functions to handle the direct to database destination.

Class

backup_migrate_destination_db_mysql
A destination type for saving to a 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));
  }
}