You are here

function backup_migrate_source_db::save_file in Backup and Migrate 8.3

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

Save the info by importing it into the database.

File

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

Class

backup_migrate_source_db
A destination type for saving to a database server.

Code

function save_file($file, $settings) {
  backup_migrate_include('files');

  // Set the source_id to the destination_id in the settings since for a restore, the source_id is the
  // database that gets restored to.
  $settings
    ->set_source($this
    ->get_id());

  // Restore the file to the source database.
  $file = backup_migrate_perform_restore($this
    ->get_id(), $file, $settings);
  return $file;
}