You are here

public function EntityShareClientCliService::ioPull in Entity Share 8.3

Same name and namespace in other branches
  1. 8 modules/entity_share_client/src/Service/EntityShareClientCliService.php \Drupal\entity_share_client\Service\EntityShareClientCliService::ioPull()
  2. 8.2 modules/entity_share_client/src/Service/EntityShareClientCliService.php \Drupal\entity_share_client\Service\EntityShareClientCliService::ioPull()

Handle the pull interaction.

Parameters

string $remote_id: The remote website id to import from.

string $channel_id: The remote channel id to import.

string $import_config_id: The import config id to import with.

\Symfony\Component\Console\Style\StyleInterface|\ConfigSplitDrush8Io $input_output: The $io interface of the cli tool calling.

callable $translate: The translation function akin to t().

File

modules/entity_share_client/src/Service/EntityShareClientCliService.php, line 64

Class

EntityShareClientCliService
Service to ease the usage of CLI tools.

Namespace

Drupal\entity_share_client\Service

Code

public function ioPull($remote_id, $channel_id, $import_config_id, $input_output, callable $translate) {
  Timer::start('io-pull');
  $import_context = new ImportContext($remote_id, $channel_id, $import_config_id);
  $this->importService
    ->importChannel($import_context);
  $batch =& batch_get();
  if ($batch) {
    drush_backend_batch_process();
    Timer::stop('io-pull');
    $input_output
      ->success($translate('Channel successfully pulled. Execution time @time ms.', [
      '@time' => Timer::read('io-pull'),
    ]));
  }
}