You are here

function backup_migrate_destination_db::save_file in Backup and Migrate 6.2

Same name and namespace in other branches
  1. 8.2 includes/destinations.db.inc \backup_migrate_destination_db::save_file()
  2. 8.3 includes/destinations.db.inc \backup_migrate_destination_db::save_file()
  3. 7.3 includes/destinations.db.inc \backup_migrate_destination_db::save_file()
  4. 7.2 includes/destinations.db.inc \backup_migrate_destination_db::save_file()

Save the info by importing it into the database.

Overrides backup_migrate_destination::save_file

File

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

Class

backup_migrate_destination_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;
}