You are here

protected function PullCommand::execute in Entity Share 8

Same name and namespace in other branches
  1. 8.2 modules/entity_share_client/src/Command/PullCommand.php \Drupal\entity_share_client\Command\PullCommand::execute()

File

modules/entity_share_client/src/Command/PullCommand.php, line 124

Class

PullCommand
Class PullCommand.

Namespace

Drupal\entity_share_client\Command

Code

protected function execute(InputInterface $input, OutputInterface $output) {
  $this
    ->setupIo($input, $output);
  try {

    // Make the magic happen.
    $update = $input
      ->getOption('update') !== FALSE;
    if ($update) {
      $this->cliService
        ->ioPullUpdates($input
        ->getArgument('remote_id'), $input
        ->getArgument('channel_id'), $this
        ->getIo(), [
        $this,
        't',
      ]);
    }
    else {
      $this->cliService
        ->ioPull($input
        ->getArgument('remote_id'), $input
        ->getArgument('channel_id'), $this
        ->getIo(), [
        $this,
        't',
      ]);
    }
  } catch (\Exception $e) {
    $this
      ->getIo()
      ->error($e
      ->getMessage());
  }
}