You are here

public function SmartlingApiWrapper::executeBatch in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.3 src/Smartling/SmartlingApiWrapper.php \Drupal\tmgmt_smartling\Smartling\SmartlingApiWrapper::executeBatch()

Executes Smartling batch.

Parameters

$batch_uid:

Return value

bool

File

src/Smartling/SmartlingApiWrapper.php, line 294
SmartlingApiWrapper.php.

Class

SmartlingApiWrapper
Class SmartlingApiWrapper @package Drupal\tmgmt_smartling\Smartling

Namespace

Drupal\tmgmt_smartling\Smartling

Code

public function executeBatch($batch_uid) {
  $result = FALSE;
  try {
    $this
      ->getApi('batch')
      ->executeBatch($batch_uid);
    $this->logger
      ->info('Smartling executed a batch:<br/>Id: @id', [
      '@id' => $batch_uid,
    ]);
  } catch (SmartlingApiException $e) {
    $this->logger
      ->error('Smartling failed to execute a batch @batch_uid:<br/>Error: @error', [
      '@batch_uid' => $batch_uid,
      '@error' => $e
        ->getMessage(),
    ]);
  }
  return $result;
}