You are here

function drush_structure_sync_import_taxonomies in Structure Sync 8

Same name and namespace in other branches
  1. 2.x structure_sync.drush.inc \drush_structure_sync_import_taxonomies()

Call back function drush_structure_sync_import_taxonomies()

The call back function name in the following format drush_{module_name}_{item_id_for_command}()

1 call to drush_structure_sync_import_taxonomies()
drush_structure_sync_import_all in ./structure_sync.drush.inc
Call back function drush_structure_sync_import_all()

File

./structure_sync.drush.inc, line 109
Drush commands for syncing structure content.

Code

function drush_structure_sync_import_taxonomies($choice = FALSE) {
  drush_print('Importing taxonomies...');
  $options = [
    'full' => 'Full',
    'safe' => 'Safe',
    'force' => 'Force',
  ];
  if (!$choice) {
    $choice = drush_choice($options, 'What import style would you like?');
  }
  if ($choice && array_key_exists($choice, $options)) {
    drush_print('Using "' . $options[$choice] . '" import style');
    StructureSyncHelper::importTaxonomies([
      'style' => $choice,
      'drush' => TRUE,
    ]);
    drush_log('Successfully imported taxonomies', 'ok');
  }
  else {
    drush_log('No choice made for import style on importing taxonomies', 'error');
  }
}