You are here

function demo_reset_set_default in Demonstration site (Sandbox / Snapshot) 8

Same name and namespace in other branches
  1. 6 demo_reset.module \demo_reset_set_default()
  2. 7 demo_reset/demo_reset.module \demo_reset_set_default()

Sets a specific snapshot as default for cron runs or the site reset block.

Parameters

$filename: The filename of the snapshot.

1 call to demo_reset_set_default()
demo_reset_demo_manage_form_submit in ./demo.module
Form submit handler for demo_manage_form().

File

./demo.module, line 889

Code

function demo_reset_set_default($filename) {
  \Drupal::service('config.factory')
    ->getEditable('demo.settings')
    ->set('demo_dump_cron', $filename)
    ->save();
  \Drupal::messenger()
    ->addMessage(t('Snapshot %title will be used for cron runs.', [
    '%title' => $filename,
  ]));
}