protected function SalesforceMappingCommandsBase::interactMapping in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_mapping/src/Commands/SalesforceMappingCommandsBase.php \Drupal\salesforce_mapping\Commands\SalesforceMappingCommandsBase::interactMapping()
- 8.3 modules/salesforce_mapping/src/Commands/SalesforceMappingCommandsBase.php \Drupal\salesforce_mapping\Commands\SalesforceMappingCommandsBase::interactMapping()
Collect a salesforce mapping interactively.
6 calls to SalesforceMappingCommandsBase::interactMapping()
- SalesforceMappingCommands::interactPurgeAll in modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommands.php - Interactively gather a salesforce mapping name.
- SalesforceMappingCommands::interactPurgeDrupal in modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommands.php - Interactively gather a salesforce mapping name.
- SalesforceMappingCommands::interactPurgeMapping in modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommands.php - Interactively gather a salesforce mapping name.
- SalesforceMappingCommands::interactPurgeSalesforce in modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommands.php - Interactively gather a salesforce mapping name.
- SalesforceMappingCommandsBase::interactPullMappings in modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommandsBase.php - Collect a salesforce mapping name, and set it to a "name" argument.
File
- modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommandsBase.php, line 75
Class
- SalesforceMappingCommandsBase
- Shared command base for Salesforce Drush commands.
Namespace
Drupal\salesforce_mapping\CommandsCode
protected function interactMapping(Input $input, Output $output, $message = 'Choose a Salesforce mapping', $allOption = FALSE, $dir = NULL) {
if ($name = $input
->getArgument('name')) {
if (strtoupper($name) == 'ALL') {
$input
->setArgument('name', 'ALL');
return;
}
/** @var \Drupal\salesforce_mapping\Entity\SalesforceMapping $mapping */
$mapping = $this->mappingStorage
->load($name);
if (!$mapping) {
$this
->logger()
->error(dt('Mapping %name does not exist.', [
'%name' => $name,
]));
}
elseif ($dir == 'push' && !$mapping
->doesPush()) {
$this
->logger()
->error(dt('Mapping %name does not push.', [
'%name' => $name,
]));
}
elseif ($dir == 'pull' && !$mapping
->doesPull()) {
$this
->logger()
->error(dt('Mapping %name does not push.', [
'%name' => $name,
]));
}
else {
return;
}
}
if ($dir == 'pull') {
$options = $this->mappingStorage
->loadPullMappings();
}
elseif ($dir == 'push') {
$options = $this->mappingStorage
->loadPushMappings();
}
else {
$options = $this->mappingStorage
->loadMultiple();
}
$this
->doMappingNameOptions($input, array_keys($options), $message, $allOption);
}