function drush_gathercontent_import_validate in GatherContent 8.4
Same name and namespace in other branches
- 8.5 gathercontent.drush.inc \drush_gathercontent_import_validate()
- 8.3 gathercontent.drush.inc \drush_gathercontent_import_validate()
- 7.3 gathercontent.drush.inc \drush_gathercontent_import_validate()
Implements drush_COMMAND_validate().
File
- ./
gathercontent.drush.inc, line 168 - 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."));
}
$createNewRevision = drush_get_option('create-new-revision');
if ($createNewRevision !== NULL && !is_bool($createNewRevision)) {
drush_set_error('gathercontent_invalid_option', dt("The --create-new-revision option doesn't accept value."));
}
if ($mapping_id !== NULL) {
$mapping = Mapping::load($mapping_id);
if (!$mapping) {
drush_set_error('gathercontent_invalid_argument', dt('Invalid mapping ID: @mapping_id', [
'@mapping_id' => $mapping_id,
]));
}
}
}