You are here

public static function ViewsBulkOperationsBatch::saveList in Views Bulk Operations (VBO) 8.2

Same name and namespace in other branches
  1. 8.3 src/ViewsBulkOperationsBatch.php \Drupal\views_bulk_operations\ViewsBulkOperationsBatch::saveList()
  2. 8 src/ViewsBulkOperationsBatch.php \Drupal\views_bulk_operations\ViewsBulkOperationsBatch::saveList()
  3. 4.0.x src/ViewsBulkOperationsBatch.php \Drupal\views_bulk_operations\ViewsBulkOperationsBatch::saveList()

Save generated list to user tempstore.

Parameters

bool $success: Was the process successfull?

array $results: Batch process results array.

array $operations: Performed operations array.

File

src/ViewsBulkOperationsBatch.php, line 92

Class

ViewsBulkOperationsBatch
Defines module Batch API methods.

Namespace

Drupal\views_bulk_operations

Code

public static function saveList($success, array $results, array $operations) {
  if ($success) {
    $results['redirect_url'] = $results['redirect_after_processing'];
    unset($results['redirect_after_processing']);
    $tempstore_factory = \Drupal::service('tempstore.private');
    $current_user = \Drupal::service('current_user');
    $tempstore_name = 'views_bulk_operations_' . $results['view_id'] . '_' . $results['display_id'];
    $results['prepopulated'] = TRUE;
    $tempstore_factory
      ->get($tempstore_name)
      ->set($current_user
      ->id(), $results);
  }
}