function batch_test_stack

Same name in other branches
  1. 7.x modules/simpletest/tests/batch_test.module \batch_test_stack()
  2. 9 core/modules/system/tests/modules/batch_test/batch_test.module \batch_test_stack()
  3. 8.9.x core/modules/system/tests/modules/batch_test/batch_test.module \batch_test_stack()
  4. 10 core/modules/system/tests/modules/batch_test/batch_test.module \batch_test_stack()

Helper function: Stores or retrieves traced execution data.

8 calls to batch_test_stack()
_batch_test_callback_1 in core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
Implements callback_batch_operation().
_batch_test_callback_2 in core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
Implements callback_batch_operation().
_batch_test_callback_5 in core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
Implements callback_batch_operation().
_batch_test_callback_6 in core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
Implements callback_batch_operation().
_batch_test_callback_7 in core/modules/system/tests/modules/batch_test/batch_test.callbacks.inc
Implements callback_batch_operation().

... See full list

File

core/modules/system/tests/modules/batch_test/batch_test.module, line 239

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.