You are here

public function SalesforceCommands::interactReadObject in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 src/Commands/SalesforceCommands.php \Drupal\salesforce\Commands\SalesforceCommands::interactReadObject()
  2. 5.0.x src/Commands/SalesforceCommands.php \Drupal\salesforce\Commands\SalesforceCommands::interactReadObject()

Read a Salesforce ID interactively.

@hook interact salesforce:read-object

File

src/Commands/SalesforceCommands.php, line 448

Class

SalesforceCommands
A Drush commandfile.

Namespace

Drupal\salesforce\Commands

Code

public function interactReadObject(Input $input, Output $output) {
  if (!$input
    ->getArgument('id')) {
    if (!($answer = $this
      ->io()
      ->ask('Enter the Salesforce id to fetch'))) {
      throw new UserAbortException();
    }
    $input
      ->setArgument('id', $answer);
  }
}