function batch_test_stack

Helper function: Stores or retrieves traced execution data.

23 calls to batch_test_stack()
batch_test_chained_form_submit_1 in drupal/core/modules/system/tests/modules/batch_test/batch_test.module
Form submission handler #1 for batch_test_chained_form().
batch_test_chained_form_submit_2 in drupal/core/modules/system/tests/modules/batch_test/batch_test.module
Form submission handler #2 for batch_test_chained_form().
batch_test_chained_form_submit_3 in drupal/core/modules/system/tests/modules/batch_test/batch_test.module
Form submission handler #3 for batch_test_chained_form().
batch_test_chained_form_submit_4 in drupal/core/modules/system/tests/modules/batch_test/batch_test.module
Form submission handler #4 for batch_test_chained_form().
batch_test_large_percentage in drupal/core/modules/system/tests/modules/batch_test/batch_test.module
Menu callback: Fires a batch process without a form submission.

... See full list

File

drupal/core/modules/system/tests/modules/batch_test/batch_test.module, line 528
Helper module for the Batch API tests.

Code

function batch_test_stack($data = NULL, $reset = FALSE) {
  if ($reset) {
    Drupal::state()
      ->delete('batch_test.stack');
  }
  if (!isset($data)) {
    return Drupal::state()
      ->get('batch_test.stack');
  }
  $stack = Drupal::state()
    ->get('batch_test.stack');
  $stack[] = $data;
  Drupal::state()
    ->set('batch_test.stack', $stack);
}