You are here

function acsf_duplication_acsf_duplication_scrub_context_alter in Acquia Cloud Site Factory Connector 8.2

Same name and namespace in other branches
  1. 8 acsf_duplication/acsf_duplication.module \acsf_duplication_acsf_duplication_scrub_context_alter()

Alters the scrub event context of `drush acsf-duplication-scrub-batch`.

Use this alter hook to add optional data to the scrub event. The data added here is available via the $this->event->context array in event handlers.

Parameters

array $data: An associative array of context data needed in the event handlers.

See also

drush_acsf_duplication_scrub_batch()

File

acsf_duplication/acsf_duplication.module, line 46
Provides site duplication handlers.

Code

function acsf_duplication_acsf_duplication_scrub_context_alter(array &$data, $options) {
  $exact_copy = isset($options['exact-copy']) ? $options['exact-copy'] : NULL;
  $scrub_options['retain_users'] = isset($options['retain-users']) ? $options['retain-users'] : $exact_copy;
  $scrub_options['retain_content'] = isset($options['retain-content']) ? $options['retain-content'] : $exact_copy;
  $batch = isset($options['batch']) ? $options['batch'] : 1000;
  $scrub_options['batch_comment'] = isset($options['batch-comment']) ? $options['batch-comment'] : $batch;
  $scrub_options['batch_node'] = isset($options['batch-node']) ? $options['batch-node'] : $batch;
  $scrub_options['batch_user'] = isset($options['batch-user']) ? $options['batch-user'] : $batch;
  $data['scrub_options'] = array_merge($data['scrub_options'], $scrub_options);
}