You are here

protected function SalesforceMappingCommandsBase::doMappingNameOptions in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 modules/salesforce_mapping/src/Commands/SalesforceMappingCommandsBase.php \Drupal\salesforce_mapping\Commands\SalesforceMappingCommandsBase::doMappingNameOptions()
  2. 5.0.x modules/salesforce_mapping/src/Commands/SalesforceMappingCommandsBase.php \Drupal\salesforce_mapping\Commands\SalesforceMappingCommandsBase::doMappingNameOptions()

Helper method to collect the choice from user, given a set of options.

1 call to SalesforceMappingCommandsBase::doMappingNameOptions()
SalesforceMappingCommandsBase::interactMapping in modules/salesforce_mapping/src/Commands/SalesforceMappingCommandsBase.php
Collect a salesforce mapping interactively.

File

modules/salesforce_mapping/src/Commands/SalesforceMappingCommandsBase.php, line 106

Class

SalesforceMappingCommandsBase
Shared command base for Salesforce Drush commands.

Namespace

Drupal\salesforce_mapping\Commands

Code

protected function doMappingNameOptions(Input $input, array $options, $message, $allOption = FALSE) {
  $options = array_combine($options, $options);
  if ($allOption) {
    $options['ALL'] = $allOption;
  }
  if (!($answer = $this
    ->io()
    ->choice($message, $options))) {
    throw new UserAbortException();
  }
  $input
    ->setArgument('name', $answer);
}