public static function SendContextActionApproveForm::finishBatch in TMGMT Translator Smartling 8.2
Same name and namespace in other branches
- 8.4 src/Form/SendContextActionApproveForm.php \Drupal\tmgmt_smartling\Form\SendContextActionApproveForm::finishBatch()
- 8.3 src/Form/SendContextActionApproveForm.php \Drupal\tmgmt_smartling\Form\SendContextActionApproveForm::finishBatch()
Finish batch callback.
Parameters
$success:
$results:
$operations:
File
- src/
Form/ SendContextActionApproveForm.php, line 286
Class
- SendContextActionApproveForm
- Provides a confirmation form for sending multiple content entities.
Namespace
Drupal\tmgmt_smartling\FormCode
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);
}