protected function SalesforceMappingCommands::purgeConfirmAndDelete in Salesforce Suite 5.0.x
Same name and namespace in other branches
- 8.4 modules/salesforce_mapping/src/Commands/SalesforceMappingCommands.php \Drupal\salesforce_mapping\Commands\SalesforceMappingCommands::purgeConfirmAndDelete()
- 8.3 modules/salesforce_mapping/src/Commands/SalesforceMappingCommands.php \Drupal\salesforce_mapping\Commands\SalesforceMappingCommands::purgeConfirmAndDelete()
Helper to confirm before destructive operation.
3 calls to SalesforceMappingCommands::purgeConfirmAndDelete()
- SalesforceMappingCommands::purgeDrupal in modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommands.php - Clean up Mapped Objects referencing missing Drupal entities.
- SalesforceMappingCommands::purgeMapping in modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommands.php - Clean up Mapped Objects by deleting records referencing missing Mappings.
- SalesforceMappingCommands::purgeSalesforce in modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommands.php - Clean up Mapped Objects by deleting records referencing missing records.
File
- modules/
salesforce_mapping/ src/ Commands/ SalesforceMappingCommands.php, line 232
Class
- SalesforceMappingCommands
- A Drush commandfile.
Namespace
Drupal\salesforce_mapping\CommandsCode
protected function purgeConfirmAndDelete(array $object_ids, $extra = '') {
if (empty($object_ids)) {
return;
}
$message = 'Delete ' . count($object_ids) . ' orphaned mapped objects';
if ($extra) {
$message .= ' for ' . $extra;
}
$message .= '?';
if (!$this
->io()
->confirm($message)) {
return;
}
// Still have to *load* entities in order to delete them. **UGH**.
$mapped_objs = $this->mappedObjectStorage
->loadMultiple($object_ids);
$this->mappedObjectStorage
->delete($mapped_objs);
}