You are here

public function backup_migrate_source_db::lock_tables in Backup and Migrate 7.3

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

Lock the database in anticipation of a backup.

File

includes/sources.db.inc, line 277
Functions to handle the direct to database destination.

Class

backup_migrate_source_db
A destination type for saving to a database server.

Code

public function lock_tables($settings) {
  if ($settings->filters['utils_lock_tables']) {
    $tables = array();
    foreach ($this
      ->get_table_names() as $table) {

      // There's no need to lock excluded or structure only tables because it doesn't matter if they change.
      if (empty($settings->filters['exclude_tables']) || !in_array($table, (array) $settings->filters['exclude_tables'])) {
        $tables[] = $table;
      }
    }
    $this
      ->_lock_tables($tables);
  }
}