You are here

public static function SendContextActionApproveForm::finishBatch in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 src/Form/SendContextActionApproveForm.php \Drupal\tmgmt_smartling\Form\SendContextActionApproveForm::finishBatch()
  2. 8.2 src/Form/SendContextActionApproveForm.php \Drupal\tmgmt_smartling\Form\SendContextActionApproveForm::finishBatch()

Finish batch callback.

Parameters

$success:

$results:

$operations:

File

src/Form/SendContextActionApproveForm.php, line 294

Class

SendContextActionApproveForm
Provides a confirmation form for sending multiple content entities.

Namespace

Drupal\tmgmt_smartling\Form

Code

public static function finishBatch($success, $results, $operations) {

  // Switch user back after batch. We have to use \Drupal::getContainer() because we don't have $this context in
  // static functions.
  $user_name_before_switching = \Drupal::getContainer()
    ->get('user.shared_tempstore')
    ->get('tmgmt_smartling_send_context')
    ->get('user_name_before_switching');
  \Drupal::getContainer()
    ->get('tmgmt_smartling.utils.context.user_auth')
    ->switchUser($user_name_before_switching);
}