You are here

function drush_gathercontent_import_validate in GatherContent 7.3

Same name and namespace in other branches
  1. 8.5 gathercontent.drush.inc \drush_gathercontent_import_validate()
  2. 8.3 gathercontent.drush.inc \drush_gathercontent_import_validate()
  3. 8.4 gathercontent.drush.inc \drush_gathercontent_import_validate()

Implements drush_COMMAND_validate().

File

./gathercontent.drush.inc, line 150
Drush command to cli config import.

Code

function drush_gathercontent_import_validate($mapping_id = NULL) {
  $publish = drush_get_option('publish');
  if ($publish !== NULL && !is_bool($publish)) {
    drush_set_error('gathercontent_invalid_option', dt("The --publish option doesn't accept value."));
  }
  if ($mapping_id !== NULL) {
    $mapping = entity_load('gathercontent_mapping', [
      $mapping_id,
    ]);
    if (!$mapping) {
      drush_set_error('gathercontent_invalid_argument', dt('Invalid mapping ID: @mapping_id', [
        '@mapping_id' => $mapping_id,
      ]));
    }
  }
}